madpress
Forum Replies Created
-
Hey guys, sorry for that dead link. I dug through my archives and think I found the code I posted at the time. You can find it here, let me know if it works. Don’t forget to replace every instance of YOUR-POST-TYPE with the name of your own custom post type.
By the way, you probably noticed that the plugin hasn’t received any updates for a while now, so it might be wise to consider a different strategy to achieve what you want!
cheers
Forum: Hacks
In reply to: add content to bottom of single posts using functions.phpAlas!
get_the_date
produces the post date, not the current (today’s) date.Forum: Hacks
In reply to: add content to bottom of single posts using functions.phpThat’s right! One more question however: is it only possible then to return stuff which you can “get”? What if I would like to display today’s date for example?
<?php echo date('l jS F Y'); ?>
And on a general note: wouldn’t it be nice to have an action hook like loop_end for inserting stuff below the post content?
Forum: Hacks
In reply to: add content to bottom of single posts using functions.phpExcuse me, but I’m not seeing clear yet. Could you elaborate a little on what should be done to get the above working properly?
Forum: Hacks
In reply to: add content to bottom of single posts using functions.phpWhoops, still a bit in the dark here. Is there a way to echo php stuff below the post content, along with the html? For example, the following displays the permalink above the post content, and the text “This is the” below the content.
function madpress_permalink() { echo the_permalink(); } add_filter('the_content', 'add_test'); function add_test($content) { if (is_single()) { $content .= '<p>This is the ' . madpress_permalink() . '</p>'; } return $content; }
Forum: Hacks
In reply to: add content to bottom of single posts using functions.phpAnother valuable lesson! Thanks ??
Forum: Hacks
In reply to: add content to bottom of single posts using functions.phpHey alchymyth, basically I wrote something like this:
function madpress_test() { echo "TEST"; } add_filter('the_content', 'add_test'); function add_test($content) { if (is_single()) { $content .= madpress_test(); } return $content; }
This inserts “TEST” between the title (and post metadata) and the post content.
Forum: Hacks
In reply to: add content to bottom of single posts using functions.phpadding to ‘the_content’ puts this content above the post content, not at the bottom where I want it to be.
I’m having the same issue, with Twenty Ten, but also with other themes. However, I see plugins using this action to add a ratings box or the like below the post content, so: any ideas what might be the problem here?
Hi Nico, I managed to get this plugin working with custom post types, you can find the adapted code here.
Forum: Fixing WordPress
In reply to: wp_nav_menu, conditional tags and fallback_cbThis specific problem was caused by a pre_get_posts filter in my functions.php. In fact, I had an issue with this filter before, so I should’ve known ??
Forum: Fixing WordPress
In reply to: Impossible to edit taxonomy from a custom post typeYour problem is caused by a capital letter in your taxonomy name, you should have ‘categories’ instead of ‘Categories’
Forum: Plugins
In reply to: Cheatin’ uh? erro on taxonomy – custom post typeMake sure the registered taxonomy name does NOT start with a capital letter!
Forum: Fixing WordPress
In reply to: How to associate a Custom Post Type to an existing category ?sure, just add this line:
'taxonomies' => array( 'post_tag', 'category '),