Tag Info

New answers tagged

0

You can use below steps to display pagination. Step 1:- Include the following snippet in your functions.php file :- function webim_pagination ( $pages = '', $range = 4 ) { $showitems = ($range * 2) + 1; global $paged; if( empty( $paged ) ) $paged = 1; if( $pages == '' ) { global $wp_query; $pages = ...


0

I really don't think it is your code failing you, but rather your template, and I would go on and say that your single template is being ingored and not being used as you have expected and accepted it to be. If you look at the Template Hierarchy and more specifcally the hierarchy for single pages, you will see that the template single-{$term}.php is not ...


0

Their archives will use archive-{post_type}.php 'has_archive' => true, has_archive (boolean or string) (optional) Enables post type archives. Will use $post_type as archive slug by default. Default: false


0

Could you go to this page for us: ../wp-admin/options-permalink.php What is the structure chosen? That will give you the answer for how to adjust the function on the bottom edit: Also, Why is this part like this: if ($echo) { echo $output; } return $output; } Shouldn't $output be in parenthesis?


2

The function next_post_link() allow excludes, with the parameter excluded_terms. Add a list of the IDs of the password protected posts to this param. You get a list of all password protected posts with the follow example via DB select. $password_pages = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ...


1

You can try to use the the_post filter, to override the content pagination, that takes place within the setup_postdata() function ( PHP 5.4+ ): /** * Ignore the <!--nextpage--> for content pagination. * * @see http://wordpress.stackexchange.com/a/183587/26350 */ add_action( 'the_post', function( $post ) { if ( false !== strpos( ...


0

I go the solution. I have take variable name like $wp_query = new WP_Query($arr); instate of $the_query = new WP_Query($arr); So my working code should be <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <?php // global $wp_query; $paged = (get_query_var('paged')) ? ...


0

Your problem comes from a fundamental misunderstanding of how WordPress loads the main loop. Here you have a main query that goes and grabs the posts to display in your post type archive. It then decides to load archive-recept.php based on that query. The call to paginate_links then provides the pagination for that main query. However, the main query isn't ...


0

Make use of the WordPress template hierarchy, by either having a home.php - home page - or a front-page.php - front page - to display the site home/front. Read the WordPress codex article Creating a Static Front Page for an insight on how to do it and some explanation about the differences. Do not use any pagination code - see the according section from the ...


0

Add this conditional statement in your custom function. if ( is_home() && get_query_var( 'paged' ) >= 2 )



Top 50 recent answers are included