Forums

[widget logic] combining supressing (with !) and also a positive command (2 posts)

  1. mradamrgreen
    Member
    Posted 10 months ago #

    Hi there,

    I have searched all through the forums and the web in general but am really struggling to find the solution to my problem...

    I basically want a widget to show up in the posts for one certain category ( or on all single posts; it doesn't matter as I only have sidebars for posts in on one category), AND ALSO to suppress this widget for a certain post AND to supress it for my category archive page (which being the only one, is all of archive pages)

    so basically i want to combine in_category('Y') with !is_single('X') with !is_archive()

    or (as the only single posts with sidebars are in one category) then I guess - is_single() with !is_single('X') with !is_archive() - should also work.

    HOWEVER i can't do it! I have tried playing around with || and && but with no luck.

    I tried experimenting with more complete PHP using elseif, but i don't know PHP at all, and couldnt get it to work.

    Any ideas how I can make this happen?

    Thank you!

  2. mradamrgreen
    Member
    Posted 10 months ago #

    well after more experimenting I managed to get the affect i want by just using supression commands:

    !is_single('529') && !is_home() && !is_archive() && !is_page( 'Resources' ) && !is_page( 'Contributions' ) && !is_page( 'About' )

    Still though it would be interesting to know how a mixture of supression and "positive" things could work.

    Would also help people who, unlike myself, can't get what they want only through supression

Reply

You must log in to post.

About this Topic