Setup wp_schedule_event within a custom plugin

First of all: if you haven’t read it already, please check the official documentation on WP-Cron. The problem in your code is this line add_action( ‘setupCronJob_whatToMine’, ‘setupCronJob’); You’re defining a new action setupCronJob_whatToMine and add the setupCronJob method to it. But as this is a custom action you just created, it will never be called … Read more

Can I add custom css to an mu-plugin?

You can actually put a directory for your style sheet right in the mu-plugins directory. I called mine “my-companies-assets”. The tricky part is calling your styles into your mu-plugin. In your main MU plugin file… // Setup MY AWESOME MU plugin url // This will help if you switch to multisite some day if (is_multisite()) … Read more

Plugin Options not being output

Basically, you’re not using the correct option name. In your viptips_settings_init() function, you use the name viptips_settings as the database option name when registering the setting: // The syntax is: register_setting( ‘<settings group name>’, ‘<database option name>’ ) register_setting( ‘pluginPage’, ‘viptips_settings’ ); So WordPress will use that viptips_settings when saving the option (i.e. update_option( ‘viptips_settings’, … Read more

Custom plugin settings link doesn’t append current class to menu item when visited? Why?

I noticed your apwb_settings_page() function is adding the “Postal Pricing Settings” submenu using add_options_page(), and the documentation stated that: (bold formatting added by me) This function is a simple wrapper for a call to add_submenu_page(), passing the received arguments and specifying ‘options-general.php‘ as the $parent_slug argument. This means the new options page will be added … Read more

WPML Plugin Not displaying multilingual Menus

I ended up having to manually detect the language, here’s how I solved it: <?php if (ICL_LANGUAGE_CODE == ‘fr’) { // display the menu en francais wp_nav_menu( array( ‘menu’ => ‘Navigation principale’, ‘theme_location’ => ‘primary’, ‘container_class’ => ‘menu-header’, ‘menu_id’ => ‘menu-primary-navigation’ ) ); } else { // show them the menu in English wp_nav_menu( array( … Read more

Redirect to another page using contact form 7? [closed]

Redirect to another page using contact form 7? [closed]

How can I replace the search results displayed by WordPress?

You can use template_include filter hook to check if the current call is a search call and if so include your own template in which you can do what ever you want : add_filter(‘template_include’,’my_custom_search_template’); function my_custom_search_template($template){ global $wp_query; if (!$wp_query->is_search) return $template return dirname( __FILE__ ) . ‘/my_search_template.php’; }