-
-
Save dexit/27c1fa3a0f8871a8d9e1c99ae1c4b707 to your computer and use it in GitHub Desktop.
Get ID from previous page
This file contains hidden or 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 | |
| function get_featured_image_func() { | |
| $postid = url_to_postid( $_SERVER['HTTP_REFERER'] ); | |
| $image = get_field('featured_image', $postid); | |
| $image = '<img src="'.$image["url"].'" />'; | |
| return $image; | |
| } | |
| add_shortcode( 'get_featured_image_shortcode', 'get_featured_image_func' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment