Stack Exchange network consists of 177 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
I need to get the title from my custom post but its showing from my default post. here is my code. please help.
Simply, echo get_the_title( $slide );
the_title(), or get_the_title() will not work here.
echo get_the_title( $slide );
It's not inside any custom loop, so the_title(); function won't work here for your custom post. It will go find the post from main query. Try echo get_the_title($slide);.
Required, but never shown