• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Automatically insert permalinks into Posts

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Automatically insert permalinks into Posts

This topic is: not resolved

Tagged: permalinks

  • This topic has 7 replies, 3 voices, and was last updated 10 years, 11 months ago by robsp.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • July 30, 2014 at 5:23 pm #116385
    robsp
    Member

    Hi All,

    Is there a way to automatically have permalinks added within each post?

    Ideally I would like to the the post's permalink added at the end of the post. Here's an example (in this case the permalink symbol used is #):

    http://randsinrepose.com/blog/

    Rob

    July 31, 2014 at 12:23 am #116403
    neilgee
    Member

    You could use the genesis_after_entry hook

    //Add Permalink after post 
    function themeprefix_permalink_after_post() {
    	echo '<p><a href="' . get_permalink() .'">';
    	the_title();
    	echo '</a></p>';
    }
    add_action( 'genesis_after_entry','themeprefix_permalink_after_post' );

    Neil Gee
    WP Beaches
    Coolest Guides

    July 31, 2014 at 6:05 pm #116494
    neilgee
    Member

    slight edit - change the_title to get_the_title

    //Add Permalink after post 
    function themeprefix_permalink_after_post() {
    	echo '<p><a href="' . get_permalink() .'">' . get_the_title() .  '</a></p>';
    }
    add_action( 'genesis_after_entry','themeprefix_permalink_after_post' );

    Neil Gee
    WP Beaches
    Coolest Guides

    July 31, 2014 at 7:59 pm #116512
    robsp
    Member

    Thanks Neil! That almost worked. The permalink did show at the bottom of posts, but only when viewing the post's full page. It didn't show on the homepage (which for my site is also the blog page). I guess that makes sense in a way.

    Also I encountered this odd error.
    1-Click to viewpost's full page
    2-Return to homepage
    3-Permalink now appears...but above the post title.

    July 31, 2014 at 8:03 pm #116515
    robsp
    Member

    What I ended up doing is placing the permalink in the date, using the code found here:

    http://genesissnippets.com/add-permalink-post_date-shortcode/

    However, I'm not sure this is what I want, so I may revisit this.

    July 31, 2014 at 9:36 pm #116523
    Genesis Developer
    Member
    //Add Permalink after post 
    function themeprefix_permalink_after_post() {
      if( is_singular('post')) :
    	echo '<p><a href="' . get_permalink() .'">' . get_the_title() .  '</a></p>';
     endif;
    }
    add_action( 'genesis_entry_header', 'themeprefix_permalink_after_post' );

    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    August 2, 2014 at 2:39 pm #116705
    robsp
    Member

    Thanks genrock. That works. It places the permalink under the title when viewing the post's page.

    August 2, 2014 at 3:36 pm #116719
    robsp
    Member

    In case anyone is interested in what I ended up doing, I opted to place the permalink next to the post date.

    Step 1: Create a permalink shortcode by placing this into the child theme's functions file:

    // Create Shortcode for Permalink
    function permalink_shortcode() {
    if (!is_page()) {
     $permalink = get_permalink();
     $permalink_symbol = '
     <a href="'.$permalink.'">#</a>
     '; 
    return $permalink_symbol;
    }}
    add_shortcode('permalink', 'permalink_shortcode');

    Step 2: If not already installed, install the awesome Simple Edits plugin:
    http://wordpress.org/plugins/genesis-simple-edits/

    Step 3:
    Add this shortcode in the 'Post Info' field of Simple Edits:
    [permalink]

    This will place the permalink symbol "#" next to the post's date. Much appreciation to anyone that wants to improve upon my newbie method/code.

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Automatically insert permalinks into Posts’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble