• Hey everyone,

    I want to add an image to my sidebar, but I don’t want the image to show in the sidebar on my blog’s homepage ( http://www.lilwaynehq.com ).

    So for example, when you view a page or a single post on my blog, I want the image to show in the sidebar.

    Does anyone know how I would do this?

    Also, this is the code which makes an image show on the homepage only:

    <?php if (is_home()) { ?>
    CODE HERE
    <?php } ?>

    So I think maybe it’s just a little editing of the above code to get this to work.

    Thanks, appreciate it.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Pages are controlled by your theme’s page.php and single posts with single.php

    Thread Starter danaldinho

    (@danaldinho)

    Yes that’s right, but there must be some code which I can add around my image to stop it displaying on the homepage right?

    That’s what I am asking

    Thanks

    Thread Starter danaldinho

    (@danaldinho)

    Anyone got any ideas?

    <?php if (is_single()) : ?>
    
    <?php endif; ?>
    <?php if (is_page()) : ?>
    
    <?php endif; ?>
    Thread Starter danaldinho

    (@danaldinho)

    Thanks sulaeman, but is there a way to make it so it’s just one code for example:

    <?php if (is_single())&is_page()) : ?>
    
    <?php endif; ?>

    Thanks again, appreciate it

    danaldinho,

    I believe you are looking for:

    <?php if (is_single() && is_page()) : ?>
    
    <?php endif; ?>
    Thread Starter danaldinho

    (@danaldinho)

    @doc4 – That didn’t work mate.

    The image’s aren’t displaying on any of the pages or single posts?

    Thread Starter danaldinho

    (@danaldinho)

    Does anyone know the code to make something show on the single post and pages only?

    This code didn’t work:

    <?php if (is_single() && is_page()) : ?>
    
    <?php endif; ?>

    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Make an image show in the sidebar on the blog pages only’ is closed to new replies.