• Hi Guys, still learning. Two Questions please.

    1. My site has three pages, “About”, “Gallery”, and “Blog”.

    The changes I made to my .post in my stylesheet have appeared on all the pages, but I wanted this style only on my “Blog” page. So what is the best way to style each page? My search has turned up using categories like this:

    <?php if (is_category('tomato')){echo 'class="tomato-red"';}
    if (is_category('cucumber')){echo 'class="cucumber-green"';} ?>

    Another site said to create different index.php files, confused as to best solution.

    2. How would I best change the sidebar depending on the page loaded? Sorry my search has turned up nothing, I apologize if this has been solved, part of my ignorance may not be knowing exactly what I should be searching for.

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • 1. Is your site using a static front page with the Blog page acting as your posts’ page?

    2. Something like:

    <?php if( is_page('Page A') ) get_sidebar('one');
    elseif( is_page('Page B') ) get_sidebar('two');
    else get_sidebar();?>

    would load sidebar-one.php in Page A, sidebar-two.php in Page B and the generic sidebar on all other pages.

    Thread Starter macart

    (@macart)

    Thanks for the reply esmi.

    Yes my site is using a static front page with the Blog page acting as my posts’ page.

    Thread Starter macart

    (@macart)

    Anyone have any thoughts on the best way to resolve my first question? Happy Holidays!

    Thread Starter macart

    (@macart)

    Anyone?

    Thread Starter macart

    (@macart)

    <?php if( is_page('Page A') ) get_sidebar('one');
    elseif( is_page('Page B') ) get_sidebar('two');
    else get_sidebar();?>

    Where does this code go? index.php?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Categories?’ is closed to new replies.