Skip to content

Instantly share code, notes, and snippets.

@thierrypigot
Created May 28, 2015 08:11
Show Gist options
  • Save thierrypigot/6805cf207678970f4a46 to your computer and use it in GitHub Desktop.
Save thierrypigot/6805cf207678970f4a46 to your computer and use it in GitHub Desktop.
WordPress : Récupérer l’url de la page statique blog
<?php
$posts_page_id = get_option( 'page_for_posts' );
$posts_page = get_page( $posts_page_id);
$posts_page_title = $posts_page->post_title;
$posts_page_url = get_page_uri( $posts_page_id );
?>
<a href="<?php echo get_bloginfo( 'url' ) .'/'. $posts_page_url; ?>">Toutes nos actualités</a>
OU
<a href="<?php echo get_bloginfo( 'url' ) .'/'. $posts_page_url; ?>"><?php echo $posts_page_title; ?></a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment