Site logo

Archived topic

entry-title

1 reply · Started by Den on April 15, 2022

Viewing posts 1–2 of 2

Hii Team,

Can you help me out with the entry-title?

I want to relocate the entry-title of posts. Means, the function should fetch the entry-title and display to the place where I've pasted the shortcode.

Is it possible? If yes, can you guys provide me the function.php code or whatever which can be useful.

EXAMPLE: https://www.linkpicture.com/q/screenshot-1_48.png

Thanks

Hi there,

you can add this PHP Snippet to create a shortcode that will return the title:

add_shortcode('db-post-title',function(){
    return get_the_title();
});

Then add the [db-post-title] shortcode in whatever markup you need.

OR Alternatively you can use a Block Element to output all kinds of dynamic content including the title. For example:

https://docs.generatepress.com/article/block-element-page-hero/

This archived topic is closed to new replies.