Home › Forums › Pro Themes › Education Hub Pro › HELP!! Making the featured Content images a hyperlink..
Tagged: education hub pro, featured content type, Hyperlinks, images
- This topic has 4 replies, 3 voices, and was last updated 8 years, 4 months ago by wensolutions.
-
AuthorPosts
-
June 5, 2016 at 10:40 am #9633DiarraParticipant
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…
June 5, 2016 at 11:48 pm #9675wensolutionsKeymasterHello @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_ThemesAfter 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!!!!
June 8, 2016 at 12:48 pm #10086DiarraParticipantThank you very much, it works like a charm!!
August 21, 2016 at 7:17 pm #15810gedbrockieParticipantGuys, 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?
August 22, 2016 at 12:50 am #15811wensolutionsKeymasterHello @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!!
-
AuthorPosts
- You must be logged in to reply to this topic.