Tag Info

New answers tagged

1

Auto-generate shortcodes from an array: You can try the following Shortcode Automat: /** * Setup the Shortcode Automat * */ function shortcode_automat_setup() { $settings = array( "get_address" => "mg_admin_address", "get_phone" => "mg_admin_phone", "get_fax" => "mg_admin_fax", "get_email" ...


2

The dashboard_glance_items filter is only useful for modifying the extra elements. The posts/comments data elements have already been displayed. Here are three ideas: Method #1 - Use the dashboard_glance_items filter: You can use the following filter setup, to remove the posts/pages/comments elements from the output of wp_dashboard_right_now(). The ...


3

Unfortunately, there is no 'filter' to remove or edit the previous items in the 'At Glance' box. EDIT I removed the "Wordpress Core Hack" part because I don't want to encourage such a behavior, and I don't want you to edit the code every time Wordpress releases a new version :) And here is a code to append custom post types stats without being clickable : ...


-2

Plugins are to extend and add to the functionality that already exists in WordPress. you can create your own.


-2

Plugins is a centralized solution. You can implement your functionality via theme. use : wp_enqueue_script, wp_enqueue_style


0

Plugins usually increases the site functionality and performances.We can add additional plugins for doing some features that are not in basic wordpress.


0

My suggestion would be to create a custom walker for the navigation. You can check the post_type of every item and if it's your custom post type get the parent items.


2

Use get_current_blog_id() to check the current site. To run on site 2 only, use this: function new_meta_values($order_id) { if ( 2 !== get_current_blog_id() ) return; /* the rest of the function code */ }


0

I don't know if you solved this, I just had same problem, Second argument in do_action has special check if it is array with only one object, In that case they use reference to object in array instead of array with object. I believe they use this method to pass and preserve reference through function with variable arguments. I used do_action_ref_array() to ...


0

add_filter('wpseo_robots', 'yoast_no_home_noindex', 999); function yoast_no_home_noindex($string= "") { if (is_home() || is_front_page()) { $string= "index,follow"; } return $string; } this should be fine i think.. somewhere in your theme functions.php and should do the trick.


0

Untested: function custom_home_exclude( $where = '' ) { $exclude = array(); $newsQuery = new WP_Query (array( "post_type" => "news", "meta_key" => "post_to_blog", "meta_value" => 1, "meta_compare" => "!=", "posts_per_page" => "-1", )); while ($newsQuery->have_posts()) ...


0

<?php echo get_the_title( $post_id ); ?> <?php get_post_image($post->ID,'large'); ?> You can customize these to your liking. or just go to http://codex.wordpress.org/Template_Tags/get_posts


1

You don't need to create additional functions, just re-use what you already have and tweak it a bit: function theme_add_bootstrap() { wp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/third_party/bootstrap/css/bootstrap.min.css' ); wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . ...


1

OK, you have two problems here. Firstly, you are enqueueing your style with wp_enqueue_script(), which is meant to be used by scripts. You should be using wp_enqueue_style Secondly, you need to understand what functions are loaded when. Plugins are loaded first, child themes second and parent themes last. So you styles gets loaded first, and then the ...


1

It looks like the xmlrpc_prepare_post filter is only applied to the output of the wp_getPost and wp_getRevision methods of the wp_xmlrpc_server class. It would be great if this code line: do_action( 'xmlrpc_call', 'wp.newPost' ); would be replaced with extra input arguments, for example: do_action( 'xmlrpc_call', 'wp.newPost', ..., $content_struct ); ...


0

There is: /** * Fires in the login page header after scripts are enqueued. * * @since 2.1.0 */ do_action( 'login_head' ); See the function login_header() in wp-login.php. What is missing is an action login_print_styles.


2

My guess would be that you are remove the action before it is actually being added in the parent theme. The parent's theme functions.php file gets loaded after the child one so it looks like your removing something that is not there yet. The 3rd parameter in remove_action() is the priority. Try playing around with that number - the default is 10 - to see ...


1

First of all, the_content is a filter hook and not action. Secondly, it will only work when post content will be access on your site front end. You can probably make use of global variables instead. e.g. $options = get_option( 'wpglobalsettings' ); and then use wherever you want to access as follows - global $options;


0

Because your $options variable is limited to just the scope of the wp_global_settings_frontend() function. What you want to do here is set it as a constant instead of a local variable. function wp_global_settings_frontend(){ define('OPTIONS', get_option('wpglobalsettings'); } add_action('the_content', 'wp_global_settings_frontend'); ...



Top 50 recent answers are included