Jump to content

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


Victory

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.