Skip to:

Different logo image for some categories

  • Hello! I have different image background’s for some of my categories. I’ve done this by that code in header.php:

    if (is_category()) {
    $cat_obj = $wp_query->get_queried_object();
    $cat_id = $cat_obj->term_id;
    $cat = ‘category_’ . $cat_id;

    And that in style.css:

    .category_1009,.category_1012,.category_1010,.category_1011,.category_1027 {
    background: #000 url(‘someimage.png’) top left repeat; background-attachment: fixed; !important;

    but now I have another issue. How can we change logo image for specified categories? I’m aware of possibility to change logo image in theme options and it’s works. But how to set different logos for categories?

    Maybe you guys can help me?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Profile photo of Hugo


    Is this really not a question more suited to the WP forum?

    My bad. Didn’t mentioned that I use BuddyPress Default 1.2.7 theme. And I want, that logo change, in that theme. Is this right place for my question?

    Ok, Ive figured it out. First I’ve disabled logo upload in default bp theme by putting that code in functions.php child theme:

    `function my_remove_bp_actions() {
    remove_action( ‘init’, ‘bp_dtheme_add_custom_header_support’ );
    add_action( ‘init’, ‘my_remove_bp_actions’, 9 );`

    and that in css:

    `#header {background:url(fani_to.png) no-repeat;}`

    Then I simply used code from my first post and I’ve added to the css:

    `body.category_1009 #header {
    background: url(fani_to2.png) no-repeat;

    It works great, thanks for your help :P

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Different logo image for some categories’ is closed to new replies.