Viewing 23 posts - 1 through 23 (of 23 total)
  • Author
    Posts
  • #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

    #873769

    Hey kelsangwangpo,

    Could you please give us a link to your website, we need more context to be able to help you.

    Best regards,
    Victoria

    #873820

    Hi Victoria,

    Sorry that I didn’t include the link!
    dev.meditation-indianapolis.org

    Cheers
    Wangpo

    #874058

    Hi,

    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,
    Rikard

    #874066

    Thanks 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!

    #874068

    I am looking for something like this, but specific to Enfold

    #874975

    Hi!

    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,
    Ismael

    #875051

    Thanks 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.

    Screenshot

    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

    #875923

    Hi,

    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,
    Ismael

    #875982
    This reply has been marked as private.
    #876476

    Hi,

    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,
    Ismael

    #876482

    Thanks. 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.

    #877329

    Hi,

    Alright. Please create a test page then post the FTP details in the private field so that we can test it.

    Best regards,
    Ismael

    #877408
    This reply has been marked as private.
    #877940

    Hi,

    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,
    Ismael

    #877987
    This reply has been marked as private.
    #878396

    Hi,

    Thank you for the update.

    Which ones are the link posts? Why are the posts duplicated as page? ( see private field )

    Best regards,
    Ismael

    #878419

    Thanks 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.

    #879458

    Hi,

    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,
    Ismael

    #879470

    Thanks 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
    Wangpo

    #879500

    Hi,

    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,
    Ismael

    #879553

    I 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.
    #879792

    Hi,

    Glad to hear that. Thanks for using Enfold :)

    Best regards,
    Nikko

Viewing 23 posts - 1 through 23 (of 23 total)
  • The topic ‘add hyperlink to featured image’ is closed to new replies.