How do I edit wp_head and/or functions.php to remove rss-feed which isnt used and dont validate?

If we look at the file /wp-includes/default-filters.php we can find these two lines in there add_action( ‘wp_head’, ‘feed_links’, 2 ); add_action( ‘wp_head’, ‘feed_links_extra’, 3 ); so if we want to remove these actions, we can do it with these two lines in functions.php: remove_action(‘wp_head’,’feed_links’,2); remove_action(‘wp_head’,’feed_links_extra’,3); So the feed links will be removed from the <head> … Read more

Super simple shortcode not working

Your problem is here: $welcomePage = get_post( 5 ); echo $welcomePage -> post_content; Shortcodes are processed on display by via a filter on the_content which is called by the function the_content(). You’ve bypassed that functionality and are echoing the raw post data. You need to output your code using a proper Loop or explicitly process … Read more

Global functions on WPMU

What you are looking for is a “MU-Plugin”– “Must-Use Plugin”.. Originally these were called “Multi-User Plugins” and were intended for exactly your purpose– to provide a way for site admins to enable functionality on all sites of an installation. Create a directory at /wp-content/mu-plugins/ and put your PHP file(s) in it. WordPress will load the … Read more

How to target only the front page (not subsequent paginated pages) in theme/plugin?

You have a misconception about is_front_page(). Lets look at the source: public function is_front_page() { // most likely case if ( ‘posts’ == get_option( ‘show_on_front’) && $this->is_home() ) return true; elseif ( ‘page’ == get_option( ‘show_on_front’) && get_option( ‘page_on_front’ ) && $this->is_page( get_option( ‘page_on_front’ ) ) ) return true; else return false; } So from … Read more

Pass Shortcode Attribute to footer Script

It’s simple. WordPress have a handy function to send variables to a registered script. It’s wp_localize_script. It work this way: //First Register Your Script wp_register_script( ‘name-of-script’, ‘http://example.com/script.js’, ”, ”, true ); //Then send dynamic variables wp_localize_script( ‘name-of-script’, ‘globalVar’, array( ‘id’ => ‘slideTarget’ ) ); //Finally invoke it on Front-End wp_enqueue_script ( ‘name-of-script’ ); This should … Read more

Programmatically Create Category and sub Category

If your question if like this: Category A – sub-category 1 – sub-category 2 – sub-category 3 Then you would create the following in your theme’s functions.php: //create the main category wp_insert_term( // the name of the category ‘Category A’, // the taxonomy, which in this case if category (don’t change) ‘category’, array( // what … Read more