Viewing 3 replies - 1 through 3 (of 3 total)
  • You can add this code to your functions.php:

    function post_slug_shortcode() {
    	global $post;
    	return $post->post_name;
    }
    add_shortcode( 'post_slug', 'post_slug_shortcode' );

    and use [post_slug] in the content.

    Thread Starter davidhelp

    (@davidhelp)

    Thank you, its working.

    But I have next problem. If i use this shortcode, its working, but if i want this shortcode in onther shortcode for example: [mbhi_hours location=”[post_slug]”], dont work.

    Please, can you help me?

    Thanks.

    Hm, in that case another shortcode wouldn’t be the best option.

    I gave a look at the Business Hours Indicator plugin code and what you are trying to accomplish doesn’t seem to be possible, as it (apparently) doesn’t provide any hook to allow the manipulation of the location attribute.

    But that is just my opinion, the best people to really tell you that are the folks of the Bussiness Hours Indicators themselves.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How display permalink in posts text’ is closed to new replies.