How to have a next page for post?

You can use the functions next_posts_link() and previous_posts_link() for that. You have to place these functions in your theme where you want the links to be seen. Possible templates for that are your archive.php, category.php depending on your needs. <div class=”navigation”> <div class=”next-posts”><?php next_posts_link(‘&laquo; Older Entries’) ?></div> <div class=”prev-posts”><?php previous_posts_link(‘Newer Entries &raquo;’) ?></div> </div> More … Read more

404 Page not found

Page templates don’t work that way. The way they work is that you create a normal Page, and then select your custom Page Template to display it with. The URL of the resulting Page is determined by the permalink structure and slug you selected.

Exclude pages by menu order

Declare the following function in your functions.php function wpse58346_wp_list_pages( $pages, $r ) { foreach( $pages as $key => $page ) { if ( 50 < $page->menu_order ) unset($pages[$key]); } return $pages; } Now before calling wp_list_pages() apply a filter as follows add_filter(‘get_pages’, ‘wpse58346_wp_list_pages’, ”, 2); And after you have called wp_list_pages() you can remove the … Read more

How to make a page unsearchable in blog search?

function hide_from_search($qry) { if (is_search()) $qry->query_vars[‘post__not_in’][] = xXx; return $qry; } add_filter(‘pre_get_posts’,’hide_from_search’); The xXx is the ID number of the page to exclude. Just read it out of the URL on the backend. When you are editing the page you want to exclude look at the URL bar. You should see “post=xXx” in there.

Dynamic href link to Contact Page

If the contact page is identified solely by the associated template, you can query for a page with the template name in meta key _wp_page_template: $args = array( ‘post_type’ => ‘page’, ‘posts_per_page’ => 1, ‘meta_query’ => array( array( ‘key’ => ‘_wp_page_template’, ‘value’ => ‘contact_template.php’ ) ) ); $contact_page = new WP_Query( $args ); if( ! … Read more

Only Display a Featured Image on First Post Page

Use the global $page, which holds the current page number. // Somewhere near the top if ( $GLOBALS[‘page’] === 1 && $image_data = get_post_thumbnail_id() ) { if ( $image_data = wp_get_attachment_image_src( $image_data, ‘full’ ) ) { if ( $image_data[1] >= 500 ) the_post_thumbnail( ‘top-post’ ); } } // Further down. $image_data still exists, no need … Read more