How to use PHPmailer in a function in WordPress
require ‘wp-includes/class-phpmailer.php’; fixed my problem, but I used a code to create a pdf and then send it in the same way.
require ‘wp-includes/class-phpmailer.php’; fixed my problem, but I used a code to create a pdf and then send it in the same way.
It looks for me that you are adding this event only when there is no such event ‘send_email_alerts_hook’ scheduled yet. Try something like this and let me know if it workded. function shedule_email_alerts() { if ( !wp_next_scheduled( ‘send_email_alerts_hook’ ) ) { wp_schedule_event(time(), ‘daily’, ‘send_email_alerts_hook’); } else { wp_reschedule_event(time(), ‘daily’, ‘send_email_alerts_hook’); } } The thing is … Read more
Have you tried changing your function names? The main one that would concern me as potentially having overlap is name(). If I’m doing a theme for myself, usually I’ll use my_ as the prefix for everything, otherwise I’ll use a unique identifier based on the name of the theme.
idk about working it back into your breadcrumbs… which by nature i think are hierarchical. but this should give you a list of the pages that have the same parent as the page you are on (aka its siblings) albeit in a totally unstyled way global $post; $args = array(‘child_of’ => $post->post_parent, ‘exclude’=> $post->ID); if … Read more
No that’s impossible. When WordPress calls a method it has to be public. You could write a public method that is called on the hook which calls a private method inside. Not sure if that makes sense though …
Modify the searchform.php, or create one in a child theme (recommended), and you should be able to modify the form all you want. This is the file that get_search_form looks for and is the file used by the default search widget, though it is not listed in the Template Hierarchy. Reference: http://codex.wordpress.org/Function_Reference/get_search_form
Only hook the function if its not the backend. if( !is_admin() ){ add_filter(‘pre_get_posts’,’my_filter_the_search’,10,1); }
global variables are not a good solution Yes, I heard this sentence a lot of times, but as you experienced, sometimes some variables need to be accessed everywhere. Some modern PHP frameworks implement advanced patterns like IOC that helps in such type of things, but wordpress lacks in that, and this is the reason a … Read more
You have the wrong values , you can’t use ← , instead use the right encoding which in that case is ← and also %s for the title. Also you only want this to run on two pages. function back_to_site_text( $translated ) { if ( in_array( $GLOBALS[‘pagenow’], array( ‘wp-login.php’, ‘wp-register.php’ ) ) ) $translated = … Read more
You cannot do that in a theme, because themes are loaded after plugins. Use a custom plugin, maybe a mu-plugin to be sure, because they are loaded earlier than normal plugins.