Jump to content

Victory

Members
  • Posts

    5
  • Joined

  • Last visited

Victory's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. 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?
  2. Yeah, I originally thought that echo would end the function immediately like return does. I use return all the time in AS3, but I had never encountered echo before. I'm using this with Thematic in WordPress, I'm using this function to add text to the page with filter hooks - just wondering, does anybody know the best way of getting the text to format to a specific section on the page? Like I use the following: add_filter('thematic_abovecomments',addText("Add comments here.","default-header")); But the text appears at the top of the page instead of formatting with the comments section. I guess I'm not using the filter hooks correctly, I can't figure it out...
  3. Thank you Doddsey! I thought the echo statement was like return... interesting in the way it works differently.
  4. Hi guys, It's a simple question really (just getting used to php - actionscript 3.0 developer!) but I need to know how I can pass a CSS class into the arguments in a PHP function, then have it apply that style to text in html. What I have so far is: <?php function addText($text,$class) { ?> <div class= $class > <p><?php echo $text ?></p> </div> <?php } ?> But it doesn't work, the <div class = $class > should be different I think. Anybody got a solution?
×
×
  • 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.