• Hi & thank you for this amazing theme.
    Is there a way to set a different header image for different categories/posts?
    (I tried using a 3rd part plugin, it works fine with default theme, sadly not with pinnacle)

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hey,
    Pinnacle doesn’t use a banner like a default theme, It’s done differently with the header being over the page title area. There isn’t a built in option to change by post or category in the free theme (premium has this).

    You can use css based on the post ids and classes in the body but that would mean you would have to add custom css for each post an category.

    Kadence Themes

    Thread Starter rinoadiary

    (@rinoadiary)

    Thank you for your quick response,
    could you please show me an example of a custom css for category?

    It could look like this:

    body.category-adventure .titleclass {
        background-repeat: no-repeat;
        background-position: center center;
        background-size: cover;
        background-image: url(https://themes.kadencethemes.com/pinnacle/wp-content/themes/pinnacle/assets/img/demo_header_01.jpg);
    }

    Kadence Themes

    Thread Starter rinoadiary

    (@rinoadiary)

    Thank you, it works! ??

    I guess I have to use a similar code for every single post, even if they belong to the category for which I’ve set a custom header?

    hannah

    (@hannahritner)

    Hey,
    If you want this to take effect on all your posts you can use this css:

    body.single-post .titleclass {
       background-repeat: no-repeat;
        background-position: center center;
        background-size: cover;
        background-image: url(https://themes.kadencethemes.com/pinnacle/wp-content/themes/pinnacle/assets/img/demo_header_01.jpg);
    }

    Hannah

    Thread Starter rinoadiary

    (@rinoadiary)

    Thank you ??
    My goal is to change the header image for every post included in a certain category (and not the ones belonging to a different category), is this possible?

    hannah

    (@hannahritner)

    To my knowledge there isn’t an option for this. At least not without editing the theme files. Sorry!

    Hannah

    Correct there is no category class in the body tag to pull from.

    Kadence Themes

    @KadenceThemes

    I have similar problem. Can you check and guide me?
    https://www.ads-software.com/support/topic/header-layout-not-working-properly?replies=1

    hannah

    (@hannahritner)

    arbazkazi,
    This forum is for Pinnacle theme only. I haven’t worked with the theme you’re using so I’m not sure I could provide much insight. Sorry!

    Hannah

    I’m not sure this what you were talking about, but maybe it can help.

    To add a category class to single articles (or categories classes, if there are more than one), I use the following. Just add it into your function.php, preferably in a child theme.

    //Add a category class to body of single posts
    add_filter('body_class','add_category_to_single');
    function add_category_to_single($classes, $class) {
    	if (is_single() ) {
    		global $post;
    		foreach((get_the_category($post->ID)) as $category) {
    			// add category slug to the $classes array
    			$classes[] = $category->category_nicename;
    		}
    	}
    	// return the $classes array
    	return $classes;
    }
    //End Add a category class to body of single posts

    Then you can consider implementing different css styles to a single article, depending on its category.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Different headers for different categories/post’ is closed to new replies.