Created
October 30, 2018 14:37
-
-
Save temsool/1ccafb5ac4ef3679e3c2e647cf6cf6c8 to your computer and use it in GitHub Desktop.
portfolio dynamic hover caption post title
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('elementor/widget/render_content', function( $content, $widget ) { | |
$settings = $widget->get_settings(); | |
if (strpos($settings['_css_classes'], "portfolio-image") !== false) { | |
$caption = get_the_title(get_the_ID()); | |
$link=get_permalink(get_the_ID()); | |
$content .= '<a class="portfolio-hover" target="_blank" href="'.$link.'">' . $caption . '</a>'; | |
} | |
return $content; | |
}, 10, 2); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment