Home Forums Pro Themes Education Hub Pro HELP!! Making the featured Content images a hyperlink..

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #9633
    Diarra
    Participant

    Hi,
    I have managed to add show my posts in the featured content area…
    ( Customized > Featured content > Featured content type )

    Now my problem is that the images that appear in the section can’t be turned into clickable images ( Hyperlink Images ) How t=do I resolve this issue?

    Thank you…

    #9675
    wensolutions
    Keymaster

    Hello @Groupeilboudo

    To make your featured content area image clickable you need to follow the steps below:
    First you need to create and activate child theme. Reference here for child theme.
    https://codex.wordpress.org/Child_Themes

    After successfully creating the child theme of this theme you need to add below code in functions.php file.

    
    function education_hub_render_featured_content( $content_details = array() ) {
    
    		if ( empty( $content_details ) ) {
    			return;
    		}
    		?>
    		<div id="featured-content">
    			<div class="container">
    				<div class="inner-wrapper featured-content-column-<?php echo absint( count( $content_details ) ); ?>">
    				<?php foreach ($content_details as $content ): ?>
    					<article>
    						<header class="entry-header"><h2 class="entry-title"><a href="<?php echo esc_url( $content['url'] ); ?>"><?php echo esc_attr( $content['title'] ); ?></h2></header>
    						<?php if ( ! empty( $content['images'] ) ): ?>
    							<img src="<?php echo esc_url( $content['images'][0]); ?>" alt="<?php echo esc_attr( $content['title'] ); ?>" width="<?php echo esc_attr( $content['images'][1]); ?>" height="<?php echo esc_attr( $content['images'][2]); ?>" /></a>
    						<?php endif ?>
    						<div class="entry-content">
    							<p><?php echo $content['excerpt']; ?></p>
    						</div>
    					</article>
    				<?php endforeach ?>
    				</div>
    			</div>
    		</div>
    
    		<?php
    
    	}
    

    By now it should be done.
    Hope this will help to resolve your issue.
    Let us know how it goes.

    Regards!!!!

    #10086
    Diarra
    Participant

    Thank you very much, it works like a charm!!

    #15810
    gedbrockie
    Participant

    Guys, I have added the above code to my own site’s child theme functions.php file as I want my featured posts on the home page to be clickable as well….for some reason the posts do not then become clickable. Any ideas?

    http://www.guitarandmusicinstitute.com

    #15811
    wensolutions
    Keymaster

    Hello @GedBrockie,

    Upon inspecting your website, we have found the featured posts (right below the slider) thumbnail image is clickable and working as it should in the featured posts area.

    If you are referring to any other section / issue, please kindly elaborate your issue further.

    Regards!!

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