简体   繁体   中英

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM