How can I get the custom post title?

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

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

Limit the word count in the post title

Updated October 11, 2016 09:03 AM

Displaying Page Title on index.php

Updated July 07, 2017 11:08 AM

Hiddind title of selected post without plugins

Updated December 20, 2017 17:08 PM

Where does Yoast SEO plugin sets the site/page title?

Updated February 28, 2017 20:08 PM

long-title posts do not want published

Updated March 13, 2019 17:08 PM