0

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

0

Simply, echo get_the_title( $slide ); the_title(), or get_the_title() will not work here.

| improve this answer | |
0

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

| improve this answer | |
  • thanks a lot bro – imran khan Sep 11 '19 at 17:47
  • 1
    If it worked, please select as correct answer. Thank you. – Sohan Zaman Sep 11 '19 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.