• Thanks for adding the sticky the other day. I had to do trial and error to get it to work, realizing that this seemed to be the only way that worked:

    PULLS ALL STICKIES:
    [loopage]
    [loop sticky=true orderby=DESC paged=9]
    [field title-link]
    [/loop]
    [/loopage]

    PULLS ALL STICKIES OF A CERTAIN CATEGORY:

    [loopage]
    [loop sticky=true orderby=DESC paged=9]
    [if type=post category=desiredCatHere]
    [field title-link]
    [/if]
    [/loop]
    [/loopage]

    ////////////////////////////////
    THINGS THAT DID NOT WORK FOR ME:

    [loopage]
    [loop type=post category=desiredCatHere orderby=DESC paged=9 sticky=true]
    [field title-link]
    [/loop]
    [/loopage]

    ~~~

    [loop type=post category=desiredCatHere orderby=DESC paged=9]
    [if sticky=true]
    [field title-link]
    [/if]
    [/loop]

    https://www.ads-software.com/plugins/custom-content-shortcode/

Viewing 1 replies (of 1 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Hello,

    Thank you for the helpful feedback. Looks like the main issue is how WP_Query handles sticky posts. I tested it, and here’s what I found:

    • If you specify a category, then the sticky post must also have that category (it must match all query parameters) to be included in the result.
    • But, if the sticky post has that category, then it doesn’t need to be sticky: since it has the right category to match the query..

    I’m not sure what is the best solution for this. In the newest update, I added a parameter for [if] to check if a post is sticky. I hope that helps.

    [if sticky]
      ..
    [/if]

    Another idea is to not use the default sticky feature, but instead create a new category called sticky. Then, you could query for it like:

    [loop category=desiredCatHere,sticky]
      [if category=sticky]
        ..
      [else]
        ..
      [/if]
    [/loop]
Viewing 1 replies (of 1 total)
  • The topic ‘Note to users re: sticky’ is closed to new replies.