How can I demonstrate themes well?

Use a multisite installation. Let the main site be your announcement page and at least on sub-site the theme demo site. Then you can use special content like WP Test on that site. Some themes might require special content, like a shop theme that needs products. You can use another, separate sub-site for these themes.

Trouble creating custom sanitization function when uploading video files

validate_file doesn’t quite work the way you’re expecting it to – it checks if $file is in the allowed files array, not just its extension/mime type. You’re looking for wp_check_filetype. However, all that ultimately does is check the extension (i.e. it doesn’t read the headers of the file/ascertain the mime type otherwise). Unless you implement … Read more

Show category and description

Just need to use get_categories and a foreach $cats = get_categories(); if ( !empty( $cats ) && !is_wp_error( $cats ) ){ foreach ( $cats as $cat ) { echo ‘<h1 class=”categoryTitle”><a href=”‘.get_category_link( $cat->term_id ).'”>’.$cat->name.'</a></h1>’; echo ‘<p class=”cateSubTitle”>’.$cat->description.'</p>’; } } To Add each one in it’s own div, just add a tag after the foreach e.g. … Read more

wpdb->insert adds too many rows

This works if add this code in functions.php? if ( ! function_exists( ‘test_setup’ ) ) : function test_setup() { $ar = array( ‘price_content’ => ‘hello’ ); $result = $wpdb->insert(‘hs_prices’, $ar); // insert ‘hello’ into ‘price_content’ } add_action( ‘after_setup_theme’, ‘test_setup’ );

Horizontal Navigation

You could use conditional statements to show the children. Depending on what your using to categorize the pages… If you were using parent / children categories it would work something like this: <?php if ( in_category( ‘New Watches’ )) { // show new watches menu } elseif ( in_category( array( ‘Classic Watches’ ) )) { … Read more

show posts in different styling

Recently I have developed a theme almost identical to yours. This is how you can achieve this: Basic idea is, create two different layouts: layout-three.php and layout-two.php We will call them based on requirement. I have used an array to achieve this. Below is the sample code for the template file (assuming you will show … Read more

Dynamic meta description

The the_ID() function that you are using in your code echos the current post id, to get current post id instead of displaying it use the function get_the_ID() as shown in the following code. Alternatively you can just use get_post() function without passing any post id as a parameter because the post id parameter is … Read more