Site logo

Archived topic

Archive page with WPSP and Element on top versus pagination

3 replies · Started by Bas on June 18, 2020

Viewing posts 1–4 of 4

I'm trying to build a 'magazine style' page by:

- Making a new page with a sidebar on the right and hiding the page title
- Showing posts with WPSP for a certain category, in 2 columns and pagination, with offset=2
- Adding an Element (hook) on top (inside_container) of the page, with a h1 heading and WPSP showing two 'featured' articles.

That looks great, so far so good. First the heading and 2 larger articles, without a sidebar, then the other articles.

But the Element should only show on the first page. I tried adding the php from this supoort topic in a a snippet. That didn't work. Added the code in the Element, but that also didn't work.

The h1 heading has to show on all pages so I assume I have to put that in a separate Element.

Can you help me out?

Hi there,

try wrapping your WPSP Shortcode in a condtion like this:

<?php
if ( !is_paged() ) {
    echo do_shortcode( '[wpsp shortcode here]' );
}
?>

Works like a charm, great! Many thanks!

Awesome - glad to be of help

This archived topic is closed to new replies.