WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] blog title and slogan , want to change it to... (3 posts)

  1. drhema
    Member
    Posted 5 years ago #

    i want to change my blog title and slogan which appears in each page and each category and title

    what i want is
    1- blog title and sloan apeas only in main page
    2- category name and description appears when browsing category ,instead of blog name and slogan

    my logo in header

    <div id="logo">
    <h1>/"><?php bloginfo('name'); ?></h1>
    <p id="slogan"><?php bloginfo('description'); ?></p>
    </div>

    i tried to use this code but always eerrors

    <div id="logo">
    <?php /* If this is a category archive */ if (is_category()) { ?>
    <h1>/"><?php bloginfo('name'); ?></h1>
    <p id="slogan"><?php echo category_description(); ?></p>

    <?php /* Everything else */ } else { ?>
    <h1>/"><?php bloginfo('name'); ?></h1>
    <p id="slogan"><?php bloginfo('description'); ?></p>
    </div>

    what errors i made
    and what is right?

  2. Dave Redfern
    Member
    Posted 5 years ago #

    <div id="logo">
    	<?php if (is_category()) { ?>
    		<h1><?php the_category(' '); ?></h1>
    		<p id="slogan"><?php echo category_description(); ?></p>
    	<?php } else { ?>
    		<h1><?php bloginfo('name'); ?></h1>
    		<p id="slogan"><?php bloginfo('description'); ?></p>
    	<?php } ?>
    </div>

    Try the above. I have cleaned it up a little and added a close to the else statement.

    If this doesn't work can you post the error you are getting.

  3. drhema
    Member
    Posted 5 years ago #

    thanks alot it works good now

Topic Closed

This topic has been closed to new replies.

About this Topic