Jump to content

Wordpress - putting category and date within a post, below a gallery?


Recommended Posts

Hi guys,


How can I put the post category and date inside a post, below an image gallery? I found how to do this with the post title, but I don't know where to start with the other stuff.



function mm_insert_title_func($atts) {
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');

This puts the post title in the main body of the text when I use:



[mm-insert-title before='<h2>' after='</h2>']

...as a shortcode in the post. How do I do a similar thing with the post category and date?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.