Insert Google authorship into WordPress header

This is a wild guess, because you didn’t provide (parts of) your template. Anyway, most probably (if lessons.php is a full template) there is get_header(); somewhere at the beginning of your template file. If you put the very code you posted in your question before this it will render, as the wp_head action is still … Read more

Trying to write a function in an external php file to manage admin menu visibility

It’s becouse you’r calling alter_item function outside action admin_menu here’s working example i just made, try to figure what’s wrong with your’s by your self, if you fail i’ll explain add_action( ‘admin_menu’, ‘alter_items’ ); function alter_items() { global $current_user, $menu; get_currentuserinfo(); $scopes = apply_filters( ‘alter_items’, array() ); if( ! empty( $scopes ) ) { foreach( … Read more

Where to place add_action when enqueueing?

Makes no difference. Despite the fact add_action doesn’t actually check if the callback is indeed callable (i.e. is a valid function/class/method), PHP will first “load” function and class definitions before executing inline code, hence why you can do something like: wpse_185390_function(); // Perfectly fine, even though the function is defined “afterwards” function wpse_185390_function() { echo … Read more

add_action to wp_head is added, but not called

Can we think litter bit different way: add_action(‘wp_head’,’new_wp_head’); function new_wp_head() { echo “calling wp_head”; global $civicrm_root; if ( empty( $civicrm_root ) ) { return; } $region = CRM_Core_Region::instance(‘html-header’, FALSE); if ( $region ) { echo ‘<!– CiviCRM html header –>’; echo $region->render( ” ); } } Make sure in which file you put this and … Read more

save_post not triggered when a post is updated

A var_dump() in save_post action doesn’t display any information on the screen. Well, it does only when you are on “Add new” screen. This is due the different sequence of actions that follow when creating a new post or when editing it. When you click on “publish” or “update” button, there is a request, the … Read more

Dynamic name of cron event

So no, I can’t see a way to grab the name of your action. However, you can pass arguments to your callback: $blog_id = get_current_blog_id(); $cron_name=”import_blog_posts_in_network_daily_”.$blog_id; if ( !wp_next_scheduled( $cron_name) ) { wp_schedule_event( time(), ‘daily’, $cron_name, array($blog_id) ); } add_action( $cron_name, array($this, ‘import_blog_posts_in_network’) ); /* public function import_blog_posts_in_network($blog_id) { // do something for blog $blog_id … Read more

Is this the correct way to enqueue style sheets from parent theme and then from child theme in wordpress?

You can try below code. I think there is no need to use wp_enqueue_scripts twice to enqueue the parent and child theme style sheets separately. Also the use of echo get_stylesheet_uri( ); in the enqueue_child_theme_styles function doesn’t make any sense. function my_theme_enqueue_styles() { $parent_style=”styles”; wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’, array(‘enough_base’) ); wp_enqueue_style( ‘child-style’, get_stylesheet_directory_uri() . … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)