Errors after update and documentation
BenRacicot opened this issue · 1 comments
BenRacicot commented
Hello, I've recently updated my plugin and am now getting the error:
Fatal error: Call to a member function get_featured_images() on a non-object in /var/www/vhosts/20dogsinabowl.com/httpdocs/wp-content/themes/twentyfourteen/about.php on line 48
On this code:
Line 48<h6><?php echo dfi_get_image_title( $featuredImages[0]["full"] ); ?> <br /> <span><?php echo dfi_get_image_caption( $featuredImages[0]["full"] );?></span></h6>
<div class="circle-div-by-hv"><img src="<?php echo $featuredImages[0]["full"]; ?>" alt="" /></div>
Can you help me understand how to get the 3 featured images from $Dynamic_Featured_Image->get_featured_images($id); and their title/caption info in version 3.0? Thank you.
ankitpokhrel commented
Hello Ben,
You can get the image title as
global $dynamic_featured_image; //this line may not be required if you have added it previously
$title = $dynamic_featured_image -> get_image_title( $featuredImages[0]["full"] )
API documentation can be found here: https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API-Functions
Thanks,
Ankit