WP 3-way voting system: On to something! Please help!

Here’s a simple solution. Append the ratings to the end of the post content: add_filter(‘the_content’, ‘add_ratings_to_content’, 4); // remove ratings from excerpts add_filter(‘get_the_excerpt’, create_function(”, ‘remove_filter(“the_content”, “add_ratings_to_content”, 6); return;’), 5); function add_ratings_to_content($content){ global $post; if(is_single()) $content .= the_ratings($post->ID); return $content; } Displays the current rating: function get_current_rating($post_id){ $votes = get_option(“votes_{$post_id}”); // handle your rating format here … Read more

Echo youtube code from url or shortcode

Hi @Саша Стефано: Maybe I’m missing something but at first glance it looks like you just need to add a return statement (I’ve not tested this code so if that’s not it let me know and I’ll dig in to figure it out): function get_youtube_kod($post_id=null) { // Get the post ID if none is provided … Read more

Comments RSS Feed showing repeating title

do_feed_* are not filter hooks, they are action hooks. Their purpose is not to modify generated markup, but only to call function that loads template. It is highly recommended to only have single function hooked to these. So correct way to use this: Remove native function that loads feed template. Create your tweaked template. Add … Read more

Different profile page by role

i needed something similar to this so i added a rewrite rule to the same author.php file and there i added a redirect based on the user role, so to put this in your use case: First redirect editor to your theme author.php file by adding this rewrite rule function my_rewrite_rules_098( $wp_rewrite ) { $newrules … Read more

Problem with shortcode inside a shortcode

Here’s a trick that wp-includes/media.php uses for the embed shortcode: first remove all shortcodes, then add a specific shortcode back to the system, filter your content for it, then re-register the original shortcodes. Try this: function etdc_tab_group( $atts, $content ){ global $shortcode_tags; $GLOBALS[‘tab_count’] = 0; // save the shortcode registrations $orig_shortcode_tags = $shortcode_tags; // remove … Read more