Combine these two codes for me please
-
I’m trying to insert a custom field into the_content.. I got these codes from around the web, can someone please help me combine the two.
Code for the custom field
<?php $source = get_post_custom_values("cf_Source");if ( !empty($source) ) {echo '' . $source[0].'';}else { echo '';}?>
Code to add something after the_content in my template’s funtions.php
function my_content($content) { $content .= 'My Content'; return $content; } add_filter('the_content', 'my_content');
I’m guessing you need to put the first code goes in where it says “My Content” but I don’t know exactly how to do that.
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Combine these two codes for me please’ is closed to new replies.