How can I get the custom post title?

by imran khan   Last Updated September 11, 2019 17:08 PM

I need to get the title from my custom post but its showing from my default post. here is my code. please help.enter image description here

Tags : php title

Answers 1

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);.

Sohan Zaman
Sohan Zaman
September 11, 2019 16:54 PM

Related Questions

Updated October 11, 2016 09:03 AM

Updated July 07, 2017 11:08 AM

Updated December 20, 2017 17:08 PM

Updated February 28, 2017 20:08 PM

Updated March 13, 2019 17:08 PM