Home>Support>Post loop additional field issue

Post loop additional field issue

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hi, thank for the great builder. I’m testing the widget bundle ass well, in particular “Post loop” widget. However, it doesn’t seem to allow to use “post__not_in” in any way. There is the “post__in” feature, but no way to add the argument “post__not_in”.

I tried to use the “Additional” field, but since “post__not_in” must be an array, it doesn’t work. Any advice? Thank you.

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

  1. 10 years, 2 months ago Magus
    Hi, I Work Here

    Hi Manuel

    Could you please post the query you are using within code tags (see below the reply box.).

    Thanks

    Magus

  2. 10 years, 2 months ago Manuel Masia

    Hi Magus, and thank you.

    Since the field turns everything into a string I don’t have idea about how to use the post__not_in argument. I tried almost everything:

    'post__not_in'=>array(123)
    post__not_in=[123]
    post__not_in=array(123)

    I know, some are obviously wrong, but I tried very approach :-) Thank you in advance

  3. 10 years, 2 months ago Magus
    Hi, I Work Here

    Hi Manuel

    You is this the entire query you are running, you mentioned post_in in your OP. Are you using post_in and post_not_in together?

    Magus

  4. 10 years, 2 months ago Manuel Masia

    No, I don’t use post__in in that particular loop, even if I use the widget twice on the same page and in one case I used post__in field.

    To clarify, in the post loop where I don’t use “post__in” I tried the three options mentioned above (one at a time of course).

    With the first attempt ( ‘post__not_in’=>array(123) ) the post is printed anyway and, with WPDEBUG enabled, it returns some notices:

    Notice: Undefined index: additional in /home/domain/public_html/wp-content/plugins/siteorigin-panels/widgets/basic.php on line 185
    
    Notice: Undefined index: additional in /home/domain/public_html/wp-content/plugins/siteorigin-panels/widgets/basic.php on line 207 

    With the 2nd and the 3rd attempta ( post__not_in=[123] ) I get also a fatal error:

    d index: additional in /home/domain/public_html/wp-content/plugins/siteorigin-panels/widgets/basic.php on line 185
    
    Notice: Undefined index: additional in /home/domain/public_html/wp-content/plugins/siteorigin-panels/widgets/basic.php on line 207
    
    Fatal error: [] operator not supported for strings in /home/domain/public_html/wp-content/plugins/siteorigin-panels/widgets/basic.php on line 238

    Thank you :-)

  5. 10 years, 2 months ago Manuel Masia

    Meanwhile I overrode the widget by adding the ability to add the minus sign before the ID of a post in the post__in field, a function checks the presence of negative IDs in that field and removes them from post__in argument to add them to post__not_in, but maybe an additional field, below the post__in one, with the same AJAX function to exclude posts instead include could be a natural solution.

    Thank you for the assistance. Manuel :-)

  6. 10 years, 2 months ago Magus
    Hi, I Work Here

    Hi Manuel

    I have been looking at the plugin and I do not believe that post_not_in will work as the query generator may need to use post_in which will cause a conflict if page_not in is used at the same time.. What you could do is to assign the posts to omit into a category of their own and then exclude that using the additional field

    cat=-excluded_cat_id
    

    Hope this helps

    Magus

  7. 10 years, 2 months ago Manuel Masia

    Thank you anyway… I don’t like to create categories or tags with the only purpose to hide posts, but really appreciate the help, thank you very much.

    Manuel :-)

  8. 10 years, 2 months ago Manuel Masia

    And sorry for the poor english of course…

  9. 10 years, 2 months ago Magus
    Hi, I Work Here

    Hi Manuel

    No worries, at least you have a working fix at the moment.

    I’ve marked this thread as a feature request. We often look through these threads to get ideas for what to add in our future updates. Hopefully, we’ll be able to add this in a future update.

    Magus

  10. 10 years, 2 months ago Manuel Masia

    Great, and thank you!

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More