Disabling Intro Section While Keeping Breadcrumbs and Entry Title

Home Forums Monument Valley Disabling Intro Section While Keeping Breadcrumbs and Entry Title

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #21198
    Lana
    Participant

    Disabling Intro Section While Keeping Breadcrumbs and Entry Title

    Resolved

    Hey there! Have you noticed this support service is provided FREE of charge?
    If you like the speed and accuracy of resolutions, please consider supporting me with a small donation. Thank you

    Consider a donation →

    Hi Oliver!

    Me again :-) I am trying to reduce my website’s page speed load and I thought that getting rid of intro image would help me. However, when I do so, breadcrumbs and H1 are gone (both of them are very important because I am search engine optimizing). Could you please let me know how I can keep those when I prefer not to use the intro section?

    Thank you!

    Best,
    Lana

    #21201
    Oliver Juhas
    Keymaster

    Hi Lana,

    You can disable the global custom header image in theme options in Appearance → Customize → Header Image → “Hide image” (you will most likely need to select some image first for the “Hide image” button to appear – there seems to be a WordPress issue with this…).

    The theme will still display an intro image for posts/pages with featured image though. To remove this image, you can use this line in your child theme‘s functions.php file:

    add_filter( 'wmhook_monument_valley_intro_custom_image_pre', '__return_empty_string' );

    You can then also use addition custom CSS to tweak the intro spacing a bit, such as:

    .intro {
    	padding-top: 4%;
    	padding-bottom: 4%;
    }

    Best regards,

    Oliver Juhas
    WebMan Design

    #21221
    Lana
    Participant

    Hi Oliver, this takes my homepage intro away as well yet I would love to keep it!

    #21222
    Oliver Juhas
    Keymaster

    Hi Lana,

    I’m not sure what you mean. The solution I’ve provided will not remove the intro section. It just removes the intro image.

    The solution actually works perfectly fine for me. Have you tried it in your child theme?

    Best regards,

    Oliver Juhas
    WebMan Design

    #21370
    Lana
    Participant

    Hi Oliver,

    Sorry for the confusion, you were right – your solution just removed the intro image. What I meant to say, it also removed the intro image of my homepage here: https://colossalbuilders.com/

    Yet I would love to keep it! I am wondering if there is a chance to keep it but get rid of the intro images on the inner pages?

    Thank you!

    #21372
    Oliver Juhas
    Keymaster

    Hi Lana,

    In that case please adapt the code to your needs, such as:

    function child_theme_intro_custom_image_pre( $pre ) {
    	if ( ! is_home() ) {
    		$pre = '';
    	}
    	return $pre;
    }
    add_filter( 'wmhook_monument_valley_intro_custom_image_pre', 'child_theme_intro_custom_image_pre' );

    Best regards,

    Oliver Juhas
    WebMan Design

    #21373
    Lana
    Participant

    Oliver, I am so sorry, but it didn’t work. The homepage’s intro image is gone after I add this code to the functions.php of my child theme.

    #21374
    Oliver Juhas
    Keymaster

    Hi Lana,

    I’m sorry, my mistake. Here is the fixed code:

    function child_theme_intro_custom_image_pre( $pre ) {
    	if ( ! is_front_page() ) {
    		$pre = '';
    	}
    	return $pre;
    }
    add_filter( 'wmhook_monument_valley_intro_custom_image_pre', 'child_theme_intro_custom_image_pre' );

    Please adapt to your needs in the future using WordPress conditional tags (functions).

    Best regards,

    Oliver Juhas
    WebMan Design

    #21376
    Lana
    Participant

    Thank you so much, Oliver!!!

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.