Why isn’t my custom function kicking in from my functions.php file?

It isn’t working because you’ve mixed up returning values and echoing values updateToPerfectURLs(the_permalink()); Here updateToPerfectURLs returns its value, but you’ve not printed it out. Try echo/etc Your second problem is the opposite, the_permalink() doesn’t return the permalink, it echos it out. So before you’ve even gotten into the function the permalink is printed out. Use … Read more

Insert wordpress tags below posts via functions.php

If all you want to do is add tags to the post body without writing them into the theme templates, all you really need to do is: add_filter( ‘the_content’, function($content) { return $content.get_the_tag_list(); } ); See get_the_tag_list() for arguments. That, by the way, is basically what the the_tags() function does. However, there are other ways … Read more

Combining wp_current_user() and a variable

What you have is mostly just PHP errors. First, dashes are not valid characters in variable names, so are going to have trouble with this– badge-id-$badge_ID— no matter what. You should be using underscores instead. Second, you need to construct the entire object variable string beforehand, rather than try to construct it as you are … Read more

Trying to the deduce shortcode from a function

I wonder if this would work: [tabs tab1=”Tab 1″ tab2=”Tab 2″ tab3=”Tab 3″] [tab id=”1″]Content for tab one goes here.[/tab] [tab id=”2″]]Content for tab two goes here.[/tab] [tab id=”3″]]Content for tab three goes here.[/tab] [/tabs] You should also check if the shortcode definitions exists: add_shortcode( ‘tabs’, ‘some_function_for_tabs’ ); add_shortcode( ‘tab’, ‘some_function_for_tab’ );

Functions are causing errors

You don’t want to add function vote_up() { […] } at the top of every post if you display more than one post on a page. You want to declare the vote_up() function in your plugin’s PHP file. Once the plugin declares the function, as long as the plugin is active, you can just call … Read more