-
AuthorPosts
-
November 7, 2017 at 7:20 am #873562
Hey team
I want to be able to add a specific url so when a feature image is clicked it leads to the designated url. Presently, when clicked the featured image goes to the post that it comes from. That isn’t ideal for my configuration.Is there a way to create a setting to allow this?
Cheers
November 7, 2017 at 4:05 pm #873769Hey kelsangwangpo,
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaNovember 7, 2017 at 5:04 pm #873820November 8, 2017 at 7:42 am #874058Hi,
There is nothing like that in the theme by default unfortunately, maybe this will help you out though? https://siteorigin.com/thread/how-to-link-a-featured-image-to-an-external-url/
Best regards,
RikardNovember 8, 2017 at 8:43 am #874066Thanks Rikard,
That pushed me in the right direction. I ended up turning the posts into a link format. Then, I ran into a new problem. I was adding the link to the image, which is the first link in the post. Maybe it has something to do with Avia, but it doesn’t see that link.
I had the thought maybe I could put the link in the excerpt or use custom fields. Could you advice me how I can change the function.php file – I imagine that is what it will take – so that the link format calls it’s url from a custom fields data called post-url?
Thanks for the great support!
November 8, 2017 at 8:49 am #874068I am looking for something like this, but specific to Enfold
November 10, 2017 at 5:24 am #874975Hi!
Are you using the grid layout? Please set the post format to link then do the modification in the following thread.
// https://kriesi.at/support/topic/posts-function-appears-to-be-broken/#post-874020
Best regards,
IsmaelNovember 10, 2017 at 8:05 am #875051Thanks Ismael
There is a conflict…We use All in One Event Calendar. When I added your code my homepage content from the menu down disappeared.
I was able to get the error details:
Fatal error: Uncaught TypeError: Argument 1 passed to Ai1ec_Exception_Handler::handle_exception() must be an instance of Exception, instance of Error given in /home2/meditbf7/public_html/dev/wp-content/plugins/all-in-one-event-calendar/lib/exception/handler.php:191 Stack trace: #0 [internal function]: Ai1ec_Exception_Handler->handle_exception(Object(Error)) #1 {main} thrown in /home2/meditbf7/public_html/dev/wp-content/plugins/all-in-one-event-calendar/lib/exception/handler.php on line 191
November 13, 2017 at 4:14 am #875923Hi,
Did you select the events custom post type or taxonomy in the Blog Posts element? Please post the login details in the private field so that we can see the settings.
Best regards,
IsmaelNovember 13, 2017 at 7:43 am #875982This reply has been marked as private.November 14, 2017 at 7:34 am #876476Hi,
I simply added the code to the enfold child theme functions file when I got the error.
You can’t add the code in the child theme. You have to modify the config-templatebuilder > avia-shortcodes > postslider.php file directly. Replace everything with the following code.
// https://pastebin.com/q4HpJewV
Best regards,
IsmaelNovember 14, 2017 at 7:42 am #876482Thanks. I had already tried that as well. Actually, I tried changing the file in the parent them and including it in my child directory (with and without the original in the parent theme). All configurations led to the error that I screenshotted for you.
Sorry for the confusion. The problem still exists.
November 16, 2017 at 4:03 am #877329Hi,
Alright. Please create a test page then post the FTP details in the private field so that we can test it.
Best regards,
IsmaelNovember 16, 2017 at 8:41 am #877408This reply has been marked as private.November 17, 2017 at 6:02 am #877940Hi,
The FTP login details are not working. I also need access to the WP dashboard. Please post the htaccess and WP login details in the private field.
Best regards,
IsmaelNovember 17, 2017 at 9:39 am #877987This reply has been marked as private.November 18, 2017 at 8:17 am #878396Hi,
Thank you for the update.
Which ones are the link posts? Why are the posts duplicated as page? ( see private field )
Best regards,
IsmaelNovember 18, 2017 at 9:02 am #878419Thanks Ismael
We display the posts within the pages. The pages provide the general information (ie Monday class) and the posts provide the specifics (ie this month’s topic). We routinely rotate the posts. This system of a post within a page allows for us to have consistent urls that we can use in print publicity. I understand the confusion about posts versus pages. Only 30 minute meditation had urls that were duplicated on both the post and page. I have modified the url for the post to be uniquely from the page
To display the posts on the homepage we use the grid layout which calls the featured image. We want the featured image to link to a specified page, but, this isn’t functioning when we add the url to an image in the post. We need a hyperlink in the article to make that happen. It is awkward for our users, they expect to get new information but get the same page that they are already on.
I hope this helps you understand what we are troubleshooting.
November 21, 2017 at 3:17 am #879458Hi,
I’m sorry but this is not going to work unless you switch to the default editor. The current post is using the advance layout builder so it’s going to ignore the post format.
Best regards,
IsmaelNovember 21, 2017 at 4:52 am #879470Thanks Ismael. Is there no way to get the advanced layout builder to recognize the post format? It almost does, in that if we put the link in the text, it works. We just need to link to work from the image.
I understand if not.
Thanks
WangpoNovember 21, 2017 at 5:37 am #879500Hi,
It’s possible with the custom fields. Edit the post, add a custom field called “custom_image_link” and then add the custom url. In the postslider.php file, look for this code around line 511.
$output .= $thumbnail ? "<a href='{$link}' data-rel='slide-".avia_post_slider::$slide."' class='slide-image' title=''>{$thumbnail}</a>" : "";
Replace it with:
$image_link = get_post_meta($the_id, 'custom_image_link', true ); if($format == 'link' && $image_link ) { $link = $image_link; } $output .= $thumbnail ? "<a href='{$link}' data-rel='slide-".avia_post_slider::$slide."' class='slide-image' title=''>{$thumbnail}</a>" : "";
Best regards,
IsmaelNovember 21, 2017 at 8:44 am #879553I was wrong…it didn’t work. Can we take a look again? I have a temporary fix because the site is live.
- This reply was modified 7 years ago by KMC DC.
November 21, 2017 at 4:07 pm #879792Hi,
Glad to hear that. Thanks for using Enfold :)
Best regards,
Nikko -
AuthorPosts
- The topic ‘add hyperlink to featured image’ is closed to new replies.