You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem with the latest release of the plugin, reported by email:
One of our clients uses your WP plugin for their Image Rotator on the home page (post ID 94), and updating to your latest version (1.10) from 1.9.1 is causing an issue with the images displaying.
From what I can tell, our issue is from the updated file, cptbc-frontend.php (~ line 74-81), and with the changed variable $post_id to get_the_ID() function:
An issue occurs if the image carousel item doesn't have an "Excerpt". Then the line $content = get_the_exceprt(); seems to revert to the global $post for the home page (post ID 94) and then updates the global $post so that get_the_ID() then returns the home page ID and not the image carousel item (therefore not displaying the image).
I think you should revert back to your variable $post_id, or check to make sure you're looking at the right post_id, or possibly rename the excerpt for the image carousel items and create a new function to retrieve that attribute. Unsure on the best fix here.
Problem with the latest release of the plugin, reported by email:
One of our clients uses your WP plugin for their Image Rotator on the home page (post ID
94
), and updating to your latest version (1.10) from 1.9.1 is causing an issue with the images displaying.From what I can tell, our issue is from the updated file,
cptbc-frontend.php
(~ line 74-81), and with the changed variable$post_id
toget_the_ID()
function:CPT-Bootstrap-Carousel/trunk/cptbc-frontend.php
Lines 73 to 81 in 21d7d9f
An issue occurs if the image carousel item doesn't have an "Excerpt". Then the line
$content = get_the_exceprt();
seems to revert to the global$post
for the home page (post ID94
) and then updates the global$post
so thatget_the_ID()
then returns the home page ID and not the image carousel item (therefore not displaying the image).I think you should revert back to your variable
$post_id
, or check to make sure you're looking at the right post_id, or possibly rename the excerpt for the image carousel items and create a new function to retrieve that attribute. Unsure on the best fix here.This may be helpful, add this function to your
cpt-bootstrap-carousel.php
file:https://www.codee.io/wordpress-excerpt-using-post-id/
then change
$content = get_the_excerpt()
to that new functioncustom_get_the_excerpt($post_id);
The text was updated successfully, but these errors were encountered: