ThemeShaper Forums » Thematic

trying to add <?php if(function_exists('wp_print')) { print_link(); } ?>

(5 posts)
  • Started 9 years ago by crgo
  • Latest reply from crgo
  • This topic is not resolved
  1. Hello I am trying to add :
    <?php if(function_exists('wp_print')) { print_link(); } ?> under the post meta

    So it reads: author| [date published] | edit
    HERE IT WOULD GO THE [ <?php if(function_exists('wp_print')) { print_link(); } ?> under the post meta ]

    Help please,

    thanks,

    love your theme....

    Posted 9 years ago #
  2. Hi,

    that a bit tricky :)

    I already described it here: how to print and send by email the posts from my blog??? for including it into a post.

    If you could tell me the exact position, I can come up with the php code for you.

    Chris

    Posted 9 years ago #
  3. I was testing this earlier with that plugin and this does work to show the link where you want it. Chris is probably a better judge of what the proper method would be so I would definitely suggest you take a gander at the discussion he linked above.

    function child_post_print($output) {
    	if(function_exists('wp_print')) {
    		return preg_replace('/<\/div><!-- .entry-meta -->/', '</div><!-- .entry-meta --><span class="under-meta-wp-print">' .print_link($print_post_text,$print_page_text,$echo = false) . '</span>' , $output);
    	 }
    	return  $output;
    }
    add_filter('thematic_postheader_postmeta','child_post_print');

    Good Luck - Gene

    Posted 9 years ago #
  4. Hi Gene,

    your solution is the better one :)

    At the time I wrote the mentioned code, the plugin was missing a function that allowed to store the generated content into a variable.

    Allow me one suggestion: In this case I would use str_replace() instead of preg_replace() .. same effect .. just a tiny bit faster.

    Chris

    Posted 9 years ago #
  5. Thanks, You guys are great! I will try and let you know here in a bit!

    cr

    Posted 9 years ago #

RSS feed for this topic

Reply

You must log in to post.