doubled content

The loop in your code: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> is saying “if I have posts, display them all – by the declared # per page” So you need to modify the loop to only display the content you need. Can you provide some information on where … Read more

Create and style menu

In your theme’s functions.php, write the following code: <?php /* ENABLING CUSTOM MENUS ————————————————– */ //add_theme_support( ‘menus’ ); register_nav_menus( array( ‘primary’=>__(‘Primary Menu’), ‘secondary’=>__(‘Secondary Menu’), ) ); ?> It’ll register two custom menu area for your theme. Then you need to achieve it with in header.php: <?php wp_nav_menu ( array ( ‘theme_location’=>’primary’, ‘fallback_cb’=>”) ); ?> This … Read more

Create a live demo gallery for themes

Solution I used the wordpress-theme-showcaseplugin to show a list of themes in the home page, and to can easily browse the theme that is currently preview I changed the way wordpress handle the permalinks. In the wp-includes/link-template.php file in get_permalink function added this code if(isset($_GET[‘preview_theme’])){ $permalink = home_url(‘?preview_theme=”.$_GET[“preview_theme’] .’&p=’ . $post->ID); }else{ $permalink = home_url(‘?p=’ … Read more

wp query problem

While comparing numbers in meta value use “meta_value_num” instead of “meta_value” ‘meta_value_num’ – Order by numeric meta value (available with Version 2.8). Also note that a ‘meta_key=keyname’ must also be present in the query. This value allows for numerical sorting as noted above in ‘meta_value’. Reference