• Resolved cbeiting

    (@cbeiting)


    I am using the Pagelines Platform Pro framework and I’ve asked them there, but I figured I’d give it a shot here.

    I have a pseudo highlight image on my ‘news’ page using:

    ?php if(is_home()):?>
    <div class="highlight_image_thing">my image is in here.</div>
    <?php endif;?>

    I put this in the template.content.php section and this works great… it only shows on my page with all my posts on it. Now, the issue I’m having is that ultimately on my site I also have a blog.

    Now the blog is a separate site in my WordPress MU install. It too is pulling this div. What I need to know is the right PHP to say:

    “OK, if you’re the news site use image X – and if you’re the blog use image Y”

    I don’t know nearly enough about PHP to do this without a little guidance. Help?

Viewing 2 replies - 1 through 2 (of 2 total)
  • How about this?

    <?php
    global $blog_id;
     if(is_home() && $blog_id == 1 ):?>
    <div class="highlight_image_thing">my image is in here.</div>
    <?php endif;?>
    <?php if(is_home() && $blog_id != 1 ):?>
    <div class="highlight_image_thing">my other image is in here.</div>
    <?php endif;?>

    Thread Starter cbeiting

    (@cbeiting)

    HELL YES. This did it.

    Thank you SO MUCH. You just made my day.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Two Blogs, One Image & is_home’ is closed to new replies.