Use title of post as argument for query

Yes! You meant to use get_the_title() which returns the title as a string. the_title instead outputs it to the browser. The same is true of many other functions in WordPress, e.g. the_post_thumbnail vs get_the_post_thumbnail or bloginfo vs get_bloginfo For future reference, a search on https://developer.wordpress.org will usually reveal related functions

How to place POST TITLE any location inside the posts page

Assuming that you place it within “The Loop”, you can use the_title() function, which will display the title. See https://codex.wordpress.org/Function_Reference/the_title . The function will not return anything outside of “The Loop”. Note that get_the_title() is similar, but does not display the title. If you used that function, you would echo get_the_title() . Note also that … Read more

How come I get internal server error even with try catch for get_the_title in functions.php?

You can avoid hard coded title tag in your theme template. Just use theme support. add_theme_support(‘title-tag’); OR, If you want to use title tag then you can do something like this. <title><?php wp_title(‘|’, true, ‘right’);?></title> You can then apply filter as /** * Filters wp_title to print a neat <title> tag based on what is … Read more

Shortcode Not Working in Slider When Added To Post Title

do_shortcode() returns the content you pass it with the shortcodes, if any, filtered out (ie, processed). So the code you’ve posted in your question won’t work the way you want it to: do_shortcode( get_the_title() ); printf( ‘<h2><a href=”%s” title=”%s”>%s</a></h2>’, get_permalink(), the_title_attribute( ‘echo=0′ ), get_the_title() ); Instead you’ll need to do something more like this: $title … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)