disabling slideshow images and keep normal header image

Home Forums Modern disabling slideshow images and keep normal header image

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #18304

    fxp
    Participant

    disabling slideshow images and keep normal header image

    Resolved

    Hi Oliver,

    I am still amazed by the themes you created, and the depth of information you provide on your site.

    The featured post titles are great in slideshow. But I would like to keep my “normal” header image on the front page, instead of having the slideshow rolling the featured images.

    No luck (yet) with reversing the add_action / remove_actions from the custom-header\class-intro.php (in my child-theme function page). Same failure by trying to alter the child-theme intro/template parts with echo the_custom_header_markup();.

    (I found a workaround with banner_image custom field, but I think I lose the image dimensions for responsive layout)

    Don’t worry if this is a “paid” question, I perfectly understand, and I am ashamed to ask. But if you could give me a hint, that would help me better understand – actually, you should even charge more as it is also for “teaching” purpose ;)

    Thanks again for your documentation.
    François

    #18305

    Oliver Juhas
    Keymaster

    Hi François,

    Thank you, I’m really glad my themes are of good use to use and that I can help.

    The simplest way to disable slideshow is to disable the NS Featured Posts plugin ;) The plugin is being used to populate the slideshow of the theme. However, if you still want to use the plugin (for its widget), you can disable the slideshow with custom code in your child theme‘s functions.php file:

    function child_theme_setup() {
    	add_filter( 'wmhook_modern_intro_get_slides', '__return_empty_array', 110 );
    }
    add_action( 'after_setup_theme', 'child_theme_setup', 100 );

    And if you would like support continuous development and free support provided, you are very welcome to consider a donation :)

    Best regards,

    Oliver Juhas
    WebMan Design

    #18322

    Oliver Juhas
    Keymaster

    François, thank you very much for donation! I really appreciate it much! :)

    Best regards,

    Oliver Juhas
    WebMan Design

    #18355

    fxp
    Participant

    Hi Oliver,

    (Welcome! ;) )
    You really did a great job gathering all the intel on this website and sharing it as much as you can.

    If you can point me in the right direction, my question was a bit “trickier” (which really means I should use one of the slider plugin your recommended): is there a way to hide the featured post images (and keep the normal background image) but keep the featured titles rolling as links.

    My tests gave either no background at all, or no slider, but not the rolling text and the normal background image.

    Really, once again, if you already know how to do, I will appreciate the hint, but don’t spend time on this. (the banner_image custom tag can do the trick for now – used it on first image – even if the responsive sizes seem to be lost).

    Thanks again.
    François.

    #18356

    Oliver Juhas
    Keymaster

    Hi fxp,

    Well, if you want to keep the slideshow and only make the background image “static”, the only way around would be indeed to set up banner_image custom field for each post, or you can force it with code in your child theme‘s functions.php file:

    function child_theme_force_banner_image( $value, $object_id, $meta_key ) {
      if (
        'banner_image' === $meta_key
        && is_front_page()
        && empty( $value )
      ) {
        $value = IMAGE_ID_HERE;
      }
      return $value;
    }
    add_filter( 'get_post_metadata', 'child_theme_force_banner_image', 10, 3 );

    This should work just fine. To find out your desired image ID, go to your WordPress media library, click the image and you will in the browser URL the ID (the value of item=). For example, you will see the URL such as yourwebsite.com/wp-admin/upload.php?item=123 – the 123 is the image ID.

    Please note that code above will only work on posts where you haven’t set any banner_image value. So, if you want to apply it on your previous posts too, just delete that custom field from them (or set it empty).

    Best regards,

    Oliver Juhas
    WebMan Design

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.