Forums

Sticky still shows up in search, tags, and categories (16 posts)

  1. bochkay
    Member
    Posted 1 year ago #

    Hey there!

    I use a sticky post on my main page, love it, need it, but, I dont want it to appear when someone does a search, or when someone brings up a tag or category, what can I do to fix it? Any idea? please help :)

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    You would need to use a custom query in your search, category & tag templates to exclude the sticky post.

  3. bochkay
    Member
    Posted 1 year ago #

    SO i would need to use this

    query_posts( array( 'post__not_in' => get_option( 'sticky_posts' ) ) );

    somewhere?

    In my search, category and tag templates?

    dumb question, but where can I find those templates at? :)

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    SO i would need to use this [...] somewhere?

    Yes.

    where can I find those templates at

    search.php, tag.php and category.php in your theme.

  5. bochkay
    Member
    Posted 1 year ago #

    I went to the editor and my theme doesnt have those? it has the following

    * Footer
    (footer.php)
    * Header
    (header.php)
    * Main Index Template
    (index.php)
    * Page Template
    (page.php)
    * Sidebar
    (sidebar.php)
    * Single Post
    (single.php)
    * Theme Functions
    (functions.php)

    Styles

    * Stylesheet
    (style.css)

  6. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Looks like your theme is either:

    - using index.php for every post listing page
    - or is including templates from a sub-folder.

    Does the theme have any sub-folders?

  7. bochkay
    Member
    Posted 1 year ago #

    what are sub folders? or where would I find them?

  8. bochkay
    Member
    Posted 1 year ago #

    there is a spot that below that says

    documentation

    for the ehader template it has a drop down list and in the list is

    is_(tag)
    and
    is_(search)

  9. keesiemeijer
    moderator
    Posted 1 year ago #

    Duplicate index.php and rename it to index.php. Same with tag (tag.php) Normally sticky posts are only shown first on the frontpage, not on category or search pages. Maybe if categories and tags have their own template this will not happen anymore
    template hierarchy

  10. bochkay
    Member
    Posted 1 year ago #

    Yikes I'm not sure how to do that I'm afraid? and there is no tag.php

  11. keesiemeijer
    moderator
    Posted 1 year ago #

    sorry, typo.

    Duplicate index.php and rename it to index.php. Same with tag (tag.php)

    try this:
    Duplicate index.php and rename it to category.php. Same with tag (tag.php)

  12. bochkay
    Member
    Posted 1 year ago #

    how do i duplicate index.php

    i dont have a tag or tag.php

  13. keesiemeijer
    moderator
    Posted 1 year ago #

    open index.php and save it as category.php and tag.php

  14. bochkay
    Member
    Posted 1 year ago #

    i'm just in the back of wordpress. i'm not sure how to do that

  15. bochkay
    Member
    Posted 1 year ago #

    ok i went to the cpanel and copied index.php twice and named it category.php and tag.php.

    didnt do anything

  16. bochkay
    Member
    Posted 1 year ago #

    ok, now I have it copied to the right location and I am seeing category.php and tag.php

    now what do I need to change? anyone? getting it :)

Topic Closed

This topic has been closed to new replies.

About this Topic