ThemeShaper Forums » Thematic

[closed]

Add Slider only to blogs front page.

(7 posts)
  • Started 4 years ago by jo
  • Latest reply from El_matador
  • This topic is not resolved
  1. So I can't seem to get the dynamic content gallery slider to run on just the front page of a blog. Is this only possible with a static home page? http://pidginmagazine.com If you go to the second page of blog posts the slider stays. I have tried variations but am not sure what I am missing.

    Below is the current code I have.

    <?php
    function slider() {
        if (is_home() || is_front_page()) { ?>
        <div id="main"><div id="container"><div id="index-top">
        <?php dynamic_content_gallery(); ?>
        </div> </div> </div><?php
        }
    }
    add_action('thematic_above_indexloop','slider');
    ?>

    Thanks in advance for any help!

    Jo

    Posted 4 years ago #
  2. the 2nd page is still considered a blog page and thus is_blog() is satisfied. maybe try just if(is_front_page)

    Posted 4 years ago #
  3. @helgatheviking
    Thanks for the reply! I tried just is_front_page and it doesn't seem to make a difference. I see what you mean by the is_home acting as is_blog, so I am keeping that out of the code. I am searching through hooks and filters to see if i can find the answer.

    Posted 4 years ago #
  4. this is totally off the top of my head so no promises, but the other possible solution might be to add it in the loop as opposed to adding it to thematic_above_indexloop. I know that inside the loop the entries are counted and you could maybe override or filter the loop to add this to the beginning:

    if ($n=1 AND !(is_paged()){ ?>
        <div id="main"><div id="container"><div id="index-top">
        <?php dynamic_content_gallery(); ?>
        </div> </div> </div><?php
        }
    }
    
    /*continue with rest of loop*/

    i also can't remember if $n is the counter... you'll have to look in the loop.

    OR.. maybe you just not !(is_paged()) in your original conditional? try that first now that i think about it.

    go here to see all the WP conditional logic
    http://codex.wordpress.org/Conditional_Tags

    Posted 4 years ago #
  5. Danieliser
    Member

    You might be better off using is_page('Page Name Here') or !is_page()

    Posted 4 years ago #
  6. oatmeal
    Member

    This worked for me at ilovelocalhfx.com/v1:


    function show_slider() {
    if (is_front_page()) {
    echo "<div id=\"slider\">";
    echo do_shortcode('[smoothslider id=1]');
    echo "</div>";
    }
    }
    add_action('thematic_header','show_slider',10);

    Posted 3 years ago #
  7. oatmeal, I'm new to wordpress and the hole thamtic which I think is awesome. I also wanted to add a slider to a page that I'm doing for Sangamon County Bar Association under angelmedina.co first before I move live. I embedded your code to my functions and it looks great but ...... what's next? how/where do I add the div and CSS to my slider?

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.