• Hello,

    I’m using Theme Horse Attitude Pro and recently have created a child theme to modify a few things. On my website https://www.lowcountryreds.com, under the “Blog” section, I would like to add images to the titles. Personally, I would like to learn how to have just an image for a title and also how to have an image and title together formatted that the image is on the left and title is centered.

    Here’s where I’m at now. Under the my Child Theme, Appearance, & Editor I have three options I’ve copied from the parent (functions.php, page.php and Styls.css). Using the support forum on my theme, I’ve added the code to my functions.php:

    if ( ! function_exists( 'attitude_theloop_for_page' ) ) :
    /**
     * Fuction to show the page content.
     */
    function attitude_theloop_for_page() {
    	global $post;
    	$meta = get_post_meta($post->ID, 'attitude_title_hide', true );
    
    	if( have_posts() ) {
    		while( have_posts() ) {
    			the_post();
    
    			do_action( 'attitude_before_post' );
    ?>
    	<section id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    		<article>
    
    			<?php do_action( 'attitude_before_post_header' ); ?>
    
    			<?php
    			if( 'on' != $meta ) {
    				?>
    				<header class="entry-header">
    	    			<h2 class="entry-title">
    	    				<?php the_title(); ?>
    	    			</h2><!-- .entry-title -->
    	  			</header>
      				<?php
    			}
    			?>	
    
      			<?php do_action( 'attitude_after_post_header' ); ?>
    
      			<?php do_action( 'attitude_before_post_content' ); ?>
    
      			<div class="entry-content clearfix">
        			<?php the_content(); ?>
        			<?php
        				wp_link_pages( array(
    						'before'            => '<div style="clear: both;"></div><div class="pagination clearfix">'.__( 'Pages:', 'attitude' ),
    						'after'             => '</div>',
    						'link_before'       => '<span>',
    						'link_after'        => '</span>',
    						'pagelink'          => '%',
    						'echo'              => 1
                   ) );
        			?>
      			</div>
    
      			<?php 
    
      			do_action( 'attitude_after_post_content' );
    
      			do_action( 'attitude_before_comments_template' ); 
    
             comments_template(); 
    
             do_action ( 'attitude_after_comments_template' );
    
             ?>
    
    		</article>
    	</section>
    <?php
    			do_action( 'attitude_after_post' );
    
    		}
    	}
    	else {
    		?>
    		<h1 class="entry-title"><?php _e( 'No Posts Found.', 'attitude' ); ?></h1>
          <?php
       }
    }
    endif;

    Being new to wordpress and website design, I’m not sure where I import the image url. I learn best by looking at the before code and after code so we can use the https://www.lowcountryreds.com/skunked/ page and the image https://www.lowcountryreds.com/wp-content/uploads/2013/12/Skunked.png

    How do I add the image to the title “skunked?”

    Thanks for your help, sorry if this question is far fetched.

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add image to a page title’ is closed to new replies.