by Garth | May 18, 2018 | PHP, Wordpress
function my_admin_menu() { $page_title = ‘Clear Stock’; $menu_title = ‘Clear Stock’; $capability = ‘manage_options’; $menu_slug = ‘/clear_stock’; $function = ‘clear_stock’; $icon_url = ”; $position =...
by Garth | May 10, 2018 | PHP, Wordpress
// Clear Stock function clear_current_stock(){ // Declare the $wpdb var global $wpdb; // Run My SQL Query (My Query is setting the meta value for stock to zero) $wpdb->query(“UPDATE wp_postmeta SET meta_value = 0 WHERE meta_key = ‘_stock'”); // Check...
by Garth | May 8, 2018 | PHP, Wordpress
<?php $user_id = get_current_user_id(); if (!empty($user_id)) { $user = wp_get_current_user(); $role = ( array ) $user->roles; // echo $role[0]; if ($role[0] == ‘free-client’ OR $role[0] == ‘administrator’) { //code here… } }...
by Garth | May 4, 2018 | PHP, Wordpress
// Custom Post 1 register_post_type( ‘courses’, array( ‘labels’ => array( ‘name’ => __( ‘Courses’ ), ‘singular_name’ => __( ‘Course’ ) ), ‘public’ => true,...
by Garth | May 4, 2018 | Debugging, Wordpress
Add this line of code at the top of your child theme function. It should get rid of your error. If not good luck debugging 🙂 wp_enqueue_script(‘jquery’);
by Garth | May 3, 2018 | PHP, Wordpress
<?php echo do_shortcode(“[shortcode]”); ?>