• Hi,
    I need to have more than one blog listing page of my site.
    Does this theme support that ?
    Thank you

Viewing 9 replies - 1 through 9 (of 9 total)
  • sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    No it does not, but I think what you are wanting would be accomplished by using Category pages. You can add categories to your post and then add those categories to your menu and when clicked on, those would take the visitor to the page showing only the posts from that particular category.

    Thread Starter makai93

    (@makai93)

    Thank you for your answer,
    I have yet diferents categories linked to the menu.
    I need a specific template for one category distinct of the other category.
    For example, I need to display a different featured-image for each category.
    Thank you

    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Can I have a link to your site, if it is live so that I can take a look? Judging by the way the html is structured in Karuna, replacing the header image with another on Category pages might end up with something that is a bit less than optimal since the header image is inserted as an html img element. I did find a way, but the top and bottom of the image gets cut off a little.

    Thread Starter makai93

    (@makai93)

    Yes, my site is online…

    To now, I just managed 1 type of posts : “the news”
    I display it using the blog page of Karuna : https://madamebenchmark.com/actualites/

    Now, I need manage another type of posts : “the team”
    For the moment, I built a page : https://madamebenchmark.com/equipe/
    But I wish manage the team width posts.

    So I need 2 catégories : “news” and “team”, and display it using those categories to my menu (as you said me).

    I want a different header image for each page : “News” and “Team”, but the header image is inserted as an html img element (I can’t modify it with CSS), that’s my problem…

    Do you have please find a solution ?
    Thank you

    Thread Starter makai93

    (@makai93)

    Can you explain me when the header image is choosen ?
    I think it is in the header.php, here :

    <?php if ( class_exists( 'WooCommerce' ) && ( is_woocommerce() || is_cart() || is_checkout() ) ) : ?>
    	<?php // Silence. ?>
    <?php elseif ( karuna_has_post_thumbnail() && karuna_jetpack_featured_image_display() && ( is_single() || is_page() ) ) : ?>
    	<?php the_post_thumbnail( 'karuna-hero' ); ?>
    <?php elseif ( is_post_type_archive( 'jetpack-testimonial' ) ) :
    
    		$jetpack_options = get_theme_mod( 'jetpack_testimonials' );
    
    		if ( isset( $jetpack_options['featured-image'] ) && '' != $jetpack_options['featured-image'] ) :
    			echo wp_get_attachment_image( (int)$jetpack_options['featured-image'], 'karuna-hero' );
    		endif;
    
    	elseif ( get_header_image() ) : ?>
    	<img src="<?php header_image(); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="" class="custom-header">
    <?php endif; // End featured/header image check. ?>der image check. ?>

    I whould like to add a new test in order to select an image for one category.

    The test might be like this :

    if (the page is a category) and (category-id == 1) => use header_image_1
    if (the page is a category) and (category-id == 2) => use header_image_2

    Could you please tell me how and where can I insert this code ?
    Thank you

    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Hmmm, on the actualities page, it looks like you may have gotten this taken care of by using a custom header image that is a blank PNG, and then setting a background image for that using the following custom CSS.

    .category-actualites img.custom-header {
        background-image: url("https://madamebenchmark.com/wp-content/uploads/2018/05/partenaires.png");
    }

    If I’m mistaken, please let me know.

    If the above solution I’m seeing works for you, you can do the same for the other category also, just using the appropriate category-name CSS class from the opening body selector.

    Yes, that would go into header.php. You would need to copy header.php over to the child theme from the original theme and then add/modify the code.

    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    You will have to change some things in the copied over file around theme name stuff.

    Thread Starter makai93

    (@makai93)

    In child-theme, I copied content.php and I modified this :

    if ( is_category('6')  ) {
    	the_excerpt(sprintf(...)
    	...
    } else {
    	the_content( sprintf(...)
    	...
    }

    Now it’s ok
    Thank you

    sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Hooray and you are welcome!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘More than one blog listing page’ is closed to new replies.