WordPress.org

Ready to get started?Download WordPress

Forums

Make link clickable (4 posts)

  1. jennifer2010
    Member
    Posted 1 year ago #

    I'm using a shortcode that calls this:

    function mm_insert_title_func($atts) {
       // Insert the post title, with optional before and after strings.
       // [mm-insert-title before='<h3>' after='</h3>']
       global $post;
       extract(shortcode_atts(array('before' => '', 'after' => '' ), $atts));
       $output = "{$before}{$post->post_title}{$after}";
    
       return $output;
    }
    add_shortcode('mm-insert-title', 'mm_insert_title_func');

    It grabs the post title so I can insert it into the post automatically. Is there a way to edit that function so that the title it grabs is linked to the post, instead of just the title's name (without manually having to do this within the post)?

    Thank you!

  2. jennifer2010
    Member
    Posted 1 year ago #

    Any ideas? Thank you!

  3. christogeretz
    Member
    Posted 1 year ago #

    http://codex.wordpress.org/Function_Reference/get_permalink plus a href.

    I think that's all you want?

  4. jennifer2010
    Member
    Posted 1 year ago #

    Hm, not sure Chris. I tried messing around with it but couldn't get it to work.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.