• Resolved engstory15

    (@engstory15)


    Hi everyone,

    I am not very good at coding and running out of ideas. Urgently need help from the amazing WP community.

    I have one sticky post on the homepage (TheStyle theme) and pagination plugin (wp_pagenavi) installed. The sticky post shows up on every page of the pagination but I want the sticky post to only show on the first page. The rest of the first page and subsequent pages would show recent posts as usual.

    Found a solution on the thread below but when I put the code in index.php, problem still exists. So where should I put this code? or should I try something else? Thanks in advance. I am on localhost and unable to provide the URL.

    Thread: https://wordpress.org/support/topic/two-loops-one-for-sticky-one-for-the-rest?replies=12

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi engstory15!

    Are you talking about this theme:
    http://www.elegantthemes.com/gallery/thestyle/

    If so, please be sure to try and keep theme specific questions on their end. 😉

    I’m not sure if you are aware of the conditional is_front_page() that may be of use in this situation. Pretty neat function to use:
    https://developer.wordpress.org/reference/functions/is_front_page/

    Hope that helps you out a little bit.

    P.S. I will mention that using query_posts can create plenty of headaches, specially when it comes to pagination. A good read on how and what to use:
    http://wordpress.stackexchange.com/a/1755

    Thread Starter engstory15

    (@engstory15)

    Hi Jose,
    Thanks for the info. As it turns out, it was the code to randomize posts on Homepage that messed up the sticky post and pagination. Once the code was deleted, it worked fine. Am working with the theme support and hopefully they could provide a solution so that I can have random posts without messing up sticky posts and pagination.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sticky post on first page only’ is closed to new replies.