Tagged: portfolio grid
-
AuthorPosts
-
July 8, 2019 at 2:59 pm #1116695
Hi all –
I’d like the titles of my Portfolio Grid items to have the same link that the images do.
Can this be achieved?
Thanks!
DJuly 9, 2019 at 1:24 am #1116826Hey sdigit,
Please refer to the following:
Best regards,
Jordan ShannonJuly 9, 2019 at 3:07 pm #1117078Hi Jordan,
Thanks for this. I added the final block of code from that post to my child theme’s functions.php:
function my_custom_title_link( $title_link, $entry ) { if( ! empty( $title_link ) ) { return $title_link; } $title_link = get_permalink( $entry->ID ); return $title_link; } add_filter( 'avf_portfolio_title_link', 'my_custom_title_link', 10, 2 );But still the portfolio grid titles aren’t links.
Am I missing something?
July 10, 2019 at 2:15 pm #1117470Hi,
Thank you for the update.
The title of the portfolio items are actually disabled. Are you using the excerpt as the title? You have to set the element’s Excerpt settings to “Title and Excerpt”.
Best regards,
IsmaelJuly 10, 2019 at 11:16 pm #1117624Thanks Ismael.
Sorry – I remember now that we’d used the excerpt as title in order to have shorter titles in the grid.
Is there any way to have the excerpt linked the way the titles normally are?
Or to have custom titles in the Portfolio Grid (different than the Portfolio Item’s actual title)?
:)
DJuly 12, 2019 at 9:47 am #1117996Hi,
I see. This is possible, but you have use a script. Try this snippet in the functions.php file.
function ava_custom_script_grid_link(){ ?> <script> (function($) { $('.grid-content').on('click', function() { var image = $(this).prev('.grid-image'); window.location.href = image.attr('href'); }); })(jQuery); </script> <?php } add_action('wp_footer', 'ava_custom_script_grid_link');Best regards,
IsmaelJuly 12, 2019 at 3:13 pm #1118105That did it!
Thank you Ismael!!
:)
DJuly 13, 2019 at 2:25 pm #1118316Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Portfolio Grid – Link Titles/Captions (in addition to images)’ is closed to new replies.
