WordPress.org

Ready to get started?Download WordPress

Forums

Cakifo
[resolved] Remove the thumbnail on top of my post in Cakifo theme (6 posts)

  1. Candra Wiguna
    Member
    Posted 5 months ago #

    This theme almost perfect, but i don't like the thumbnail on every single post. I know the thumbnail show up only if i set featured image, but i need to set featured image for slider.

    Anyone can solve my problem?? Thanks before.
    *Sorry for my english

  2. Jesper Johansen (jayjdk)
    Member
    Theme Author

    Posted 5 months ago #

    Hello Candra,

    I haven't tested this code but I think it will work. First you should create a child theme (see https://github.com/jayj/Cakifo/wiki/Child-themes) and put this code in the child theme functions.php:

    add_action( 'after_setup_theme', 'my_child_setup', 11 );
    
    function my_child_setup() {
    
    	/* Get the parent theme prefix. */
    	$prefix = hybrid_get_prefix();
    
    	/* Filter Get the Image arguments */
            add_filter( 'get_the_image_args', 'my_child_hide_thumbnail' );
    
            /* Other Actions and filters calls go here. */
    }
    
    function my_child_hide_thumbnail( $args ) {
    	if ( ! cakifo_is_active_slider() ) {
    		return false;
    	}
    
    	return $args;
    }

    Hope that helps. If it does not work, please write again.

    - Jesper

  3. Candra Wiguna
    Member
    Posted 5 months ago #

    I'am trying on localhost but not working.
    But this child theme work for Cakifo 1.5

  4. Jesper Johansen (jayjdk)
    Member
    Theme Author

    Posted 5 months ago #

    Sorry! This should work:

    add_action( 'after_setup_theme', 'my_child_setup', 11 );
    
    function my_child_setup() {
    
    	/* Get the parent theme prefix. */
    	$prefix = hybrid_get_prefix();
    
    	/* Filter Get the Image output */
            add_filter( 'get_the_image', 'my_child_hide_thumbnail' );
    
            /* Other Actions and filters calls go here. */
    }
    
    function my_child_hide_thumbnail( $output ) {
    	if ( ! cakifo_is_active_slider() ) {
    		return false;
    	}
    
    	return $output;
    }
  5. Candra Wiguna
    Member
    Posted 5 months ago #

    It's working, thank you.. :)

  6. Jesper Johansen (jayjdk)
    Member
    Theme Author

    Posted 5 months ago #

    Fantastic! You're welcome :)

Reply

You must log in to post.

About this Theme

About this Topic