Current WordPress Page Title as Search Parameter into A Tag

Your shortcode is getting the title, but you haven’t told it to return anything, so a small tweak should fix things: <?php function post_title_shortcode(){ return get_the_title(); } add_shortcode(‘post_title’,’post_title_shortcode’); ?> You could also continue setting get_the_title() to $variable and add a line to return $variable, but the above is the simplest, shortest option.

How to add logged in username after WordPress URL?

You can try this shortode in this plugin file or you can paste this method to bottom of active theme’s functions.php. If you are new to WordPress and need a help you can visit here for steps to add code in function. add_shortcode( ‘my-awesome-button’, ‘wp_my_awesome_bytton’ ); function wp_my_awesome_bytton( $atts ) { $button_html=””; if ( is_user_logged_in() … Read more

Rewrite rule regex help required

Our custom rewrite rule works for top-level services but not child services. Your rewrite rule, or the query (the second parameter for add_rewrite_rule()) is just missing a service query: add_rewrite_rule( // wrapped for brevity ‘^consultancy/(.*)/?’, // Here, add the &service=$matches[1] ‘index.php?post_type=service&name=$matches[1]&service=$matches[1]’, ‘top’ ); But, why don’t you just use consultancy as the rewrite slug when … Read more