[Resolved] How do I insert content into the theme without using a hook?

Home Forums Support [Resolved] How do I insert content into the theme without using a hook?

Home Forums Support How do I insert content into the theme without using a hook?

  • This topic has 2 replies, 2 voices, and was last updated 4 years ago by David.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #834353
    Kemo

    Hi!

    I want to insert this:

    <div class="meta-container">
    		<div class="meta-avatar">
    			<? echo get_avatar( get_the_author_meta('user_email'), $size = '150'); ?>
    		</div>				
    		<div class="meta-info">
    			<div class="meta-author meta-text">
    				<em>written by</em>
    				<strong><?php the_author(); ?></strong>
    			</div>			
    			<div class="meta-date meta-text">
    				<em>first posted on</em>
    				<strong><?php the_date(); ?></strong>
    			</div>	
    			<div class="meta-modified meta-text">
    				<em>last updated on</em>
    				<strong><?php the_modified_date(); ?></strong>
    			</div>
    	</div>
    	</div>

    in position: after_entry_title. specifically, I want to replace the regular post’s meta. How can I do this in functions.php of my child theme, without using hooks? I don’t like the hooks as they are more difficult to move between sites (i have several blogs.)

    GeneratePress 2.2.2
    GP Premium 1.7.8
    #834414
    Kemo

    I figured it out. I disable the meta output in customizer and use something like this in functions.php:

    
    add_action( 'generate_after_entry_title', 'better_meta' );
    function better_meta(){
        if ( is_singular() ) { ?>
            html
        <?php } 
    }
    #834461
    David
    Staff
    Customer Support

    Hi there,

    glad you found a solution.

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