Display a Custom Post Type within another with hierarchically slug

Base on comment, you need to create a little function to display these related posts. You can do it in different ways, here is an simple example by adding your own action to the template. in your template file place where you want to show related lessons do_action(‘related_lesson’); In functions.php function get_related_lesson(){ global $post; $args … Read more

Show post by slug sanitize_title

Except the title of the post is echo sanitize_title(news_get_meta(‘gamers’)); I’m assuming news_get_meta is a function particular to a theme or plugin you have installed, so your query should be: $query = new WP_Query( array( ‘post_type’ => ‘spa’, ‘name’ => sanitize_title( news_get_meta(‘gamers’) ); ) );

Get child-pages slugs of current page into js-file

I just found what is arguably a cleaner way to do this…thanks to this other WPSE question How do I add a php statement to a jQuery string. I never new about wp_localize_script() until reading the answer to that question (I love WPSE :-). PHP add_action (‘wp_enqueue_scripts’, ‘localize_js’) ; function localize_js () { global $post … Read more

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