Home>Support>posts_per_page and offset not working in siteorigin page builder widgets

posts_per_page and offset not working in siteorigin page builder widgets

Hi there,

I found out that the query of the post loop widget in the siteorigin page builder does not take into consideration the posts_per_page and offset vars if you select the only sticky posts or exclude sticky posts from the UI.
This tested with Unwind theme (free).

Regards,
George

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 7 days, 15 hours ago Alex S Hi, I Work Here

    Hi George,

    Can you please elaborate on the issue you’re facing? I’ve run some tests and the Posts Per Page setting and additional offset value is working as expected for me. while using SiteOrigin Unwind and Twenty-Twenty. Please note that the Posts Per Page setting is recommended over the adding posts_per_page to the additional field.

    For reference, here’s what each of the Sticky Posts options does:

    Default – Sticky posts are appended to search results and offset isn’t applied to Sticky Posts. This is the WordPress default.
    Ignore sticky – Don’t move the sticky posts to the front of the results, but will still allow for them to appear.
    Exclude – Exclude all sticky posts from post loop.
    Only Sticky – Only display sticky posts.

    Kind regards,
    Alex

  2. 6 days, 10 hours ago gkorakas

    Hi Alex,

    I tried to use the Posts Per Page setting in the first place together with the Only Sticky setting and this is not working. All the above are tested in a new clean WP installation using the Unwind theme and the siteorigin Page builder plugin with the post loop widget. Inside post loop I have used the post slider template with Only sticky and another post loop with the Blog grid template.

    George

  3. 5 days, 16 hours ago Alex S Hi, I Work Here

    Hi George,

    I’m having trouble replicating this result. Can you please clarify what value you set Posts Per Page to? Ideally, can you please provide me with a screenshot of your settings? You can upload the screenshot to Imgur or vgy.me. WordPress is designed to disregard the offset if the Posts Per Page setting is set to -1. There are also other situations where WordPress will intentionally disregard your selections if other settings prevent them from working as intended – these limitations typically can’t be avoided. Inspecting your adjusted setting values will allow me to identify if the results you’re getting are expected.

    Kind regards,
    Alex

  4. 4 days, 11 hours ago gkorakas

    Hi Alex,

    I set Posts Per Page to be 1 and I check the Only Sticky option. Please find screenshot with settings and the posts I use.

    https://i.vgy.me/VDSt8Z.png
    https://i.vgy.me/UT3ljn.png

    Waiting for you reply.
    Regards,
    George

  5. 3 days, 14 hours ago gkorakas

    I have tested the

    $GLOBALS['wp_query']->request

    after

    query_posts

    has run inside inc/widgets/post-loop.php of the panels plugin and I get the following query:

    SELECT SQL_CALC_FOUND_ROWS testwp_posts.ID
    FROM testwp_posts
    WHERE 1 = 1
    AND testwp_posts.ID IN (8, 10)
    AND testwp_posts.post_type = ‘post’
    AND (testwp_posts.post_status = ‘publish’ OR testwp_posts.post_status = ‘private’)
    ORDER BY testwp_posts.post_date DESC
    LIMIT 0, 1

    and this is correct as the SQL gives only 1 result.

    I still cannont find who mess with query after that.

Please log in to post on our forums. Signing up is free.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More