Slider/Sticky post/Home page problem

Viewing 5 posts - 1 through 5 (of 5 total)
  • #7674
    Akasashasha
    Participant

    Hello,
    the sticky posts that appears in the sliders also appears below the slider on the home page … how to change this (keeping them in slider but not below on home page) ?

    thanx

    #7888
    Helder
    Participant

    a negative condition on the main loop in index.php.

    while( have_posts() ) : the_post();
    php if(!is_sticky()):
    php get_template_part( ‘content’, get_post_format() );
    php endif;
    php endwhile;

    Just insert that second line and you should be fine.

    Hope this helps.

    • This reply was modified 12 years, 1 month ago by Helder.
    • This reply was modified 12 years, 1 month ago by Helder.
    #9360
    Akasashasha
    Participant

    sorry but this is not working, or maybe a <?php is missing somewhere ?

    #11395
    karona513
    Participant

    Helder, your tip was extremely helpful. I just want to add that there is one additional line that needs to be added for it to work:

    php if( have_posts() ):
    php while( have_posts() ) : the_post();
    php if(!is_sticky()):
    php get_template_part( ‘content’, get_post_format() );
    php endif;
    php endwhile;

    Add line 2 and line 5. Could never have figured it out without the starting tip! Thx.

    #11402
    Akasashasha
    Participant

    I solved it another way, I added the following lines to the function.php (as suggested by someone on wordpress forum) :

    sh..t after three editing : not possible to add a piece of code here ? the php tags are all gone and half of what I added disappeared … ggrrr

    • This reply was modified 11 years, 11 months ago by Akasashasha.
    • This reply was modified 11 years, 11 months ago by Akasashasha.
    • This reply was modified 11 years, 11 months ago by Akasashasha.
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.