badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Featured image removal

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #24096
    christian
    Participant

    Hi, when I set-up a post I upload a featured image. When someone clics on the post i dont want the featured image to appear again in the post. Here is an example of what i mean: http://christianhelmut.net/brutal-truth-about-why-you-are-not-making-money-online/

    1. I want the featured image to appear in the home site but not in the actual post itself. How can i do that?

    2. In the live preview, below the banner a row with 3 elements appear: Elegant Design (and an image) Responsive design (and an image) HTML5 & CSS3 (and an image). How can i add those elements to my site?

    Thanks a lot!

    christian

    #24115

    Hi christian,

    We have designed our theme this way. If you don’t want featured image to display then it needs code customization. You just go to the theme folder-> inc-> structure-> content-extension.php and go to line no 276 to 287 and you will find this below code.

                <?php
                if( has_post_thumbnail() ) {
                  $image = '';              
                    $title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) );
                    $image .= '<figure class="post-featured-image">';
                    $image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">';
                    $image .= get_the_post_thumbnail( $post->ID, 'featured', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>';
                    $image .='<span class="arrow"></span>';
                    $image .= '</figure>';
                    echo $image;
                }
              } ?>

    Remove this above code and your featured image will not be displayed. Before making any changes first of all create a child theme then only customize the code to be safe from data loss while updating to our new version. If you feel its difficult then remove it from core file. But after new version update you need to do the above process again and again whenever you update.

    Thank you!

    #24240
    christian
    Participant

    Hi, how do i create a child theme?

    #24263

    Hi christian,

    please view this link to create a child theme
    https://codex.wordpress.org/Child_Themes

    Thank you!

    #25181
    Dale
    Participant

    Hello, after backing up my site and following the instructions at the link you provided, I have the child theme installed. I tried copying the content-extensions.php file into my \ultimate-pro-child\inc\structure\ folder and modifying it there (deleting lines 276 to 287) but it did not create the desired effect.

    style.css:

    /*
     Theme Name:   Ultimate Pro Child
     Template:     ultimate-pro
     Version:      1.0.0
     Text Domain:  ultimate-pro-child
    */

    functions.php:

    
    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array('parent-style')
        );
    } ?>
    

    I need to know how to fit your changes into this child theme. Thanks.

    #25216

    This is an example how to unhook page 404.php and use your own content.

    unhook functions

    // Unhook default Thematic functions
    function unhook_thematic_functions() {
    // Don’t forget the position number if the original function has one

    remove_action( ‘attitude_404_content’, ‘attitude_display_404_page_content’, 10 );

    }
    add_action(‘init’,’unhook_thematic_functions’); // removes the header content by using hook attitude_header

    add_action( ‘attitude_404_content’, ‘attitude_child_display_404_page_content’, 10 );
    /**
    * function to show the footer info, copyright information
    */

    Hi Dale,

    First of all you need to unhook the functions and then only customize the code in your child theme functions.php. Here is a simple example how to unhook functions and customize the code.

    // Unhook default Thematic functions
    function unhook_thematic_functions() {
        // Don't forget the position number if the original function has one
    
    remove_action( 'attitude_404_content', 'attitude_display_404_page_content', 10 );
    
    }
    add_action('init','unhook_thematic_functions'); // removes the header content by using hook attitude_header
    
    add_action( 'attitude_404_content', 'attitude_child_display_404_page_content', 10 );
    /**
     * function to show the footer info, copyright information
     */
     
     
    function attitude_child_display_404_page_content() {      ?>   
    <div id="content">
    		<header class="entry-header">
    			<h1 class="entry-title"><?php _e( 'Error 404-Page NOT Found', 'attitude' ); ?></h1>
    		</header>
    		<div class="entry-content clearfix" >
    			<p>Thank you</p> 
    		</div><!-- .entry-content -->
    	</div><!-- #content -->
      <?php 
    }

    Do in this way for content-extension.php and if you are unable to fix it then you need to hire a developer to fix it.

    Thank you!

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