WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Sticky posts (6 posts)

  1. Luigino
    Member
    Posted 5 years ago #

    Hello everyone!!!

    if I put sticky posts in categories, they would also appear in the main page, not only when I go in categories...so I would ask you how I could avoid to show sticky posts in main page and to put indeed a sticky post only for a main page (maybe in this case it's enough just to not put that post in any category and it would be in main page, am I right?)

    Thanks to all!
    Ciao,
    Luigi

  2. MichaelH
    Member
    Posted 5 years ago #

    Might want to review Nathan's guide on sticky posts:
    http://www.nathanrice.net/blog/definitive-sticky-posts-guide-for-wordpress-27/

  3. Luigino
    Member
    Posted 5 years ago #

    Hello MichaelH!

    Thanks for your answer....I read that page but it didn't answered to my question... I knew already about the option about stickying/unstickying a post but my question was about to NOT show the sticky post of a category in the main page but only when I click on that category.
    For example: normally when I enter in a site I would have a sticky general post (like in general category which is an universal category) to welcome to the website. Indeed when I click on a category that I listed in a sidebar because each category is an office I would hide the general category sticky and show the selected category sticky.... is there something like a function that manages that? like that "is_sticky()" one?...

    Thanks!!
    Ciao
    Luigi

    B.T.W. about categories: since I'd like to add an email to each office (category) is there a way to add another field or option to category because in a template I'd like to create a <select> that shows to the user the category listing with get_categories(parameters) and in the value the email address...and I was thinking for that way so when I create/delete an office (a category) I would have also to manage the email address... ?

  4. MichaelH
    Member
    Posted 5 years ago #

    but my question was about to NOT show the sticky post of a category in the main page but only when I click on that category.

    query_posts('caller_get_posts=1');

    the category listing with get_categories(parameters) and in the value the email address

    Guess you could use the category description to store the email.

  5. Luigino
    Member
    Posted 5 years ago #

    Hello MichaelH.

    I'm here again with sticky posts....

    I installed a new fresh 2.7.1 wordpress with default theme and I created a category "xyz" then I created a sticky post related to that category.
    then I put in index.php that query_posts('caller_get_posts=1'); BEFORE <?php if (have_posts()) : ?> (even tried also after) to make the sticky post not appearing in main page but when I click on that category's link.... and it doesn't disappear from main page.... why?....

    Thanks
    Luigi

    P.S. about email I used category description as your suggest.

  6. fanalejr
    Member
    Posted 5 years ago #

    Hey buddy,
    If i'm reading this right, the reason its not working for you is that its not supposed to be a separate line. The 'caller_get_posts=1' is part of your query_posts argument... so off hand it would be something like this:

    query_posts('caller_get_posts=1&amp;showposts=3&amp;cat=6');

    This codex page should help you out, they go into sticky's more towards the bottom

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.