[Support request] Custom content.php

Home Forums Support Custom content.php

  • This topic has 1 reply, 2 voices, and was last updated 10 months ago by Leo.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1118588
    Vuong

    Hello,I just edit my content.php to add some div,i remove default code in content.php and add new code,i just wonder is it ok ? pls check it
    Here is default code in content.php

    <div class="inside-article">
    		<?php
    		/**
    		 * generate_before_content hook.
    		 *
    		 * @since 0.1
    		 *
    		 * @hooked generate_featured_page_header_inside_single - 10
    		 */
    		do_action( 'generate_before_content' );
    		?>
    
    		<header class="entry-header">
    			<?php
    			/**
    			 * generate_before_entry_title hook.
    			 *
    			 * @since 0.1
    			 */
    			do_action( 'generate_before_entry_title' );
    
    			the_title( sprintf( '<h2 class="entry-title" itemprop="headline"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
    
    			/**
    			 * generate_after_entry_title hook.
    			 *
    			 * @since 0.1
    			 *
    			 * @hooked generate_post_meta - 10
    			 */
    			do_action( 'generate_after_entry_title' );
    			?>
    		</header><!-- .entry-header -->

    I changed these code to

    <div class="inside-article">
    	<div class="post-image">		
    <?php if ( has_post_thumbnail() ) : ?>
        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
            <?php the_post_thumbnail(); ?>
        </a>
    <?php endif; ?>
    	<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title (); ?></a></h2>
    	</div>

    My question is :
    1.Is it ok with my site ?,i wonder if my new code affect seo or something like that.
    2.Should i remove hooks connected with old code ? eg: ‘ generate_before_content hook.’ if yes pls tell me how.
    Tks much!

    #1118658
    Leo
    Staff
    Customer Support

    Hi there,

    Did you do this in a child theme environment?

    If so make sure that’s done as the changed will be erased during the theme update.

    I’m not sure what your code is supposed to achieve? But if you don’t notice any issues then it should work.

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