Note that there are some explanatory texts on larger screens.

plurals
  1. POApplying anchor link to WordPress pagination twice on same page
    primarykey
    data
    text
    <p>For my <a href="http://mtthwbsh.com" rel="nofollow noreferrer">portfolio site</a>, I would like to add anchor links to both the 'work' and 'blog' sections so that when clicked through to the next page it goes to the respective section. I noticed this is possible using jQuery from this question: <a href="https://stackoverflow.com/questions/13362026/wordpress-pagination-adding-an-anchor-link">WordPress pagination - Adding an Anchor link</a>, but am unsure how this would work with two loops on the same page?</p> <p>my current loops look like this, just replacing categories for each section:</p> <pre><code> &lt;?php $paged = (get_query_var('page')) ? get_query_var('page') : 1; $args=array('category_name'=&gt;'portfolio','posts_per_page'=&gt;4,'paged'=&gt;$paged); query_posts($args); if (have_posts()) : while (have_posts()) : the_post(); ?&gt; &lt;div class="blog-post"&gt; &lt;div class="thumbnail"&gt; &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt; &lt;?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?&gt; &lt;/a&gt; &lt;a class="details" href="&lt;?php the_permalink(); ?&gt;"&gt; &lt;h6&gt;&lt;?php echo get_the_excerpt(); ?&gt;&lt;/h6&gt; &lt;/a&gt;&lt;!-- DETAILS --&gt; &lt;/div&gt;&lt;!-- THUMBNAIL --&gt; &lt;div class="aside"&gt; &lt;h4&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h4&gt; &lt;/div&gt;&lt;!-- ASIDE --&gt; &lt;/div&gt;&lt;!-- BLOG - POST --&gt; &lt;?php endwhile; ?&gt; &lt;div class="navigation"&gt; &lt;h3&gt;&lt;?php posts_nav_link('&amp;#8734;','&amp;#171; Newer Posts','Older Posts &amp;#187;'); ?&gt;&lt;/h3&gt; &lt;/div&gt;&lt;!-- PAGED-NAVIGATION --&gt; &lt;?php wp_reset_query(); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload