Header custom post 2 - by Kunstwerk - on WordPress WooCommerce support

This topic has 8 replies, 2 voices, and was last updated 2 years, 8 months ago ago by Olga Barlow

  • Avatar: Kunstwerk
    Kunstwerk
    Participant
    July 20, 2021 at 12:11

    Sorry, I closed my topic to soon. Later I realized that it was not exact the solution I needed. Because the post type “museum” has no featured image selected. I will start over with the old posts and try to explain again with ontother example.

    1. Hi,
    with this setting in the customizer.
    https://gyazo.com/594d9af75a02245ea339fff4a887e774
    and this code you gave me:
    add_filter(‘etheme_backstretch_enqueue’, function($post_types){
    $post_types[] = ‘muziek’;
    $post_types[] = ‘bibliotheek’;
    return $post_types;
    });
    I’ll have a a featured image on a single post for the custom post type “muziek” and “bibliotheek”
    but can you also give a code so that now I can have a featured image for the post type “muziek” but a breadcrumb header for the custom post type “bibliotheek” like this:
    https://gyazo.com/53a94816aa2390cfaca0867cd505a6b5
    with regard Robert

    2. Hello,

    So, in other words you need the featured image for the muziek but don’t need that for the bibliotheek?
    Then replace code with this one
    add_filter(‘etheme_backstretch_enqueue’, function($post_types){
    $post_types[] = ‘muziek’
    return $post_types;
    });

    Olga

    3. No that is not what I meant because for the post type ‘Museum’ you see now this:
    https://gyazo.com/e45b673973c60433724dbfeab08c741a
    And I want to see this:
    https://gyazo.com/b7c22c06999db0de1d55adb7c219693a
    The breadcrumb header
    with regard,
    Robert
    4.
    add_action(‘wp’, function () {
    global $post;
    if ( $post && is_object($post)) {
    if ( in_array( $post->post_type, array( ‘museum’ ) ) ) {
    set_query_var( ‘et_post-template’, ‘default’ );
    }
    }
    }, 2);

    New question:
    I take for this example the post_type ‘muziek’ because than we have all features I want.
    I want the possibility for a special single post_type to see this:

    https://gyazo.com/d37f41c6aada1581fec3b530ca26312c

    But with a selected featured image so that I can make this:

    https://gyazo.com/1038847c376fec2fb882d4860a6b74a3

    If I use the last code you gave me:
    add_action(‘wp’, function () {
    global $post;
    if ( $post && is_object($post)) {
    if ( in_array( $post->post_type, array( ‘museum’ ) ) ) {
    set_query_var( ‘et_post-template’, ‘default’ );
    }
    }
    }, 2);

    it only works if there is no featured image selected. if you select a featured image than I’ll get this picture in the header and a big picture in the single post.

    Please, contact administrator
    for this information.
    7 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    July 21, 2021 at 08:34

    Hello,

    Truly saying I’m confused and don’t understand what do you want because you asked to show featured image for custom post types then you need breadcrumbs for them and it’s confusing.

    For the custom post type that should have the featured image use the code below:

    add_filter('etheme_backstretch_enqueue', function($post_types){
    	$post_types[] = 'muziek';
            $post_types[] = 'one_more_custom_type';
            $post_types[] = 'one_more_custom_type';
            $post_types[] = 'one_more_custom_type';
    	return $post_types;
    });

    For the custom post type that should have breadcrumbs without featured image use the code below:

    add_action('wp', function () {
    	global $post;
    	if ( $post && is_object($post)) {
    		if ( in_array( $post->post_type, array( 'museum', 'bibliotheek', 'one_more_custom_type', 'one_more_custom_type' ) ) ) {
    		set_query_var( 'et_post-template', 'default' );
    		}
    	}
    }, 2); 

    Regards

    Avatar: Kunstwerk
    Kunstwerk
    Participant
    July 21, 2021 at 13:36

    Yes, it is confusing and thank you for your patience. But for some post_type I need the image of the feature image only to make a page with a post grid like this:
    https://gyazo.com/1038847c376fec2fb882d4860a6b74a3
    With the code:

    add_action(‘wp’, function () {
    global $post;
    if ( $post && is_object($post)) {
    if ( in_array( $post->post_type, array( ‘museum’, ‘bibliotheek’, ‘muziek’ ) ) ) {
    set_query_var( ‘et_post-template’, ‘default’ );
    }
    }
    }, 2);

    I’ll get:
    https://gyazo.com/2de4f4fe65d0a31dbdab5d7131febbf9
    And I don’t want to see the first big picture(featured image) and in the header I want there the background picture of the breadcrumbs:
    https://gyazo.com/263fd695a3d9adcdeed73b3113a3872a
    Is this possible please.

    with regard,

    Robert

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    July 21, 2021 at 18:39

    Hello,

    You can hide that image using custom CSS. Provide us with link to that post type from your screenshot.

    Regards

    Avatar: Kunstwerk
    Kunstwerk
    Participant
    July 22, 2021 at 08:04

    Ok, see link in private area. But is it than also possible to change the featured image to the background image of the breadcrumbs without deleting the featured image in this post? Because I need the featured image for the post grid.

    Please contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    July 22, 2021 at 17:43

    Hello,

    Add the below code to Theme Options > Custom CSS

    .single .type-muziek .post-header {
        display: none;
    }

    Regards

    Avatar: Kunstwerk
    Kunstwerk
    Participant
    July 29, 2021 at 12:31

    thnx! final question. is it also possible to change the image of the header with another image than the featured image?

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    July 30, 2021 at 09:50

    Hello,

    We don’t have such option. Submit customization request here.

    Regards

  • Viewing 8 results - 1 through 8 (of 8 total)

The issue related to '‘Header custom post 2’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.