Trying to insert a div ID link into Woocommerce shortcode Pagination

A certain chatty AI found me a solution. add_action( ‘wp_footer’, ‘custom_pagination_script’ ); function custom_pagination_script() { ?> <script type=”text/javascript”> jQuery( document ).ready( function( $ ) { $( ‘.page-numbers a’ ).click( function( event ) { event.preventDefault(); var link = $( this ).attr( ‘href’ ); window.location = link + ‘#d3c-psf-products’; } ); } ); </script> <?php } add_action( … Read more

Archive pagination – second page shows exactly the same posts

Put this code <div class=”row”> <div class=”col-md-8 col-md-offset-2″> <?php $args = array( ‘posts_per_page’ => 3, ‘post_type’ => ‘work’, ‘paged’ => get_query_var(‘paged’) ? get_query_var(‘paged’) : 1 ); $myposts = new WP_Query($args); ?> <?php single_term_title(); ?> <?php if ( $myposts->have_posts() ) : ?> <?php while ( $myposts->have_posts() ) : $myposts->the_post(); ?> <?php get_template_part( ‘content’, get_post_format() );?> <?php … Read more

Pagenavi with archive page

It always displays the first page because you tell it to: ‘paged’ => ‘1’ 🙂 That said changing main query and especially pagination inside a template is inherently unreliable. For proper customization of such you should always be adjusting main query before template is ever reached via appropriate hooks, typically pre_get_posts.

Add tags to long page that is broken up into subpages?

You have to add tag support to your Pages. function page_tags() { register_taxonomy_for_object_type(‘post_tags’,’pages’); // adds tag support add_meta_box(‘tagsdiv-page_tag’,’tags’,’post_tags_meta_box’,’page’,’side’,’low’); // adds the meta box itself } add_action(‘admin_init’,’page_tags’); You still won’t see tags anywhere. You can move the meta box around using the ‘side’ and ‘low’ parameters. See the link below. Now look in TwentyEleven’s content-single.php and … Read more