function latest_post_button() {
// Get the most recent post
$recent_post = wp_get_recent_posts(array(
'numberposts' => 1,
'post_status' => 'publish'
))[0];
// Get the post URL and title
$post_url = get_permalink($recent_post['ID']);
$post_title = $recent_post['post_title'];
// Create button HTML
$button_html = 'Read Latest Post';
return $button_html;
}
add_shortcode('latest_post_button', 'latest_post_button');
[latest_post_button]
WE ARE
- EFFICIENT
- RELIABLE
- ADAPTABLE
- RESOURCEFUL
- INNOVATIVE
- RESPONSIVE
- SUPPORTIVE