How to create button with dynamic links (that automatically updates with the last blog post link in a category) in Wordpress

475 Views Asked by At

As title says I am trying to have a button on my home page that automatically updates the link with the link of the last blog post in a certain category

1

There are 1 best solutions below

0
Dmitry On

You need to code shortcode (in child theme functions.php for example or make a plugin), that will generate this button HTML output, fetch last post url and add it to button. Then you can use something like [last_post_button] anywhere where you need.