Chris Cook
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: widgets doesn’t appear in my themeadd to your functions.php
/* New Sidebar */ function my_new_sidebar_widget_init() { register_sidebar( array( 'name' => 'New Sidebar', 'id' => 'my_new_sidebar', 'before_widget' => '<div>', 'after_widget' => '</div>', 'before_title' => '<h2>', 'after_title' => '</h2>', ) ); } add_action( 'widgets_init', 'my_new_sidebar_widget_init' );
Then add this code in theme to use it
<?php dynamic_sidebar( 'my_new_sidebar' ); ?>
Forum: Fixing WordPress
In reply to: Enable Payment gateway if ACF checkbox in user profile is checkedThanks I found the solution.
/* * Enable COD for account holder */ function enable_cod_payment( $available_gateways ) { global $woocommerce; $user = wp_get_current_user(); $user_status = get_field('account_holder', $user ); if ($user_status == 'Yes') { $available_gateways['cod']; unset( $available_gateways['authorize_net_cim_credit_card'] ); } else { unset( $available_gateways['cod'] ); } return $available_gateways; } add_filter( 'woocommerce_available_payment_gateways', 'enable_cod_payment' );
- This reply was modified 5 years, 9 months ago by Steven Stern (sterndata).
Forum: Fixing WordPress
In reply to: Enable Payment gateway if ACF checkbox in user profile is checkedThanks. This gives me some insight but i’m still not sure how to write that into my function.
- This reply was modified 5 years, 9 months ago by Chris Cook.
I have this error as well and it shows on all /account/ pages. I have tried disabling plugins and switching themes and still get this error.
Forum: Plugins
In reply to: [Easy Appointments] 12 hour time in backendReally? No options for this?
Forum: Plugins
In reply to: [Easy Appointments] Monthly Slots instead of weeklyI am looking to do this as well. I would like the user to be limited to a certain amount of appointments they can make per month.
Example: the user can only set 2 appointments per month for that current month. On the first of the next month it resets.
Thank you.
- This reply was modified 6 years, 9 months ago by Chris Cook.
Forum: Plugins
In reply to: [Easy Appointments] 12 hour clock instead of 24?How can i implement 12 hour time on the backend for editors to see instead of 24 hour time?
I got it working using pa_color
I keep getting this error when trying to show image swatches on products page.
“Warning: Invalid argument supplied for foreach() in /home/mindclk/public_html/pv/wp-content/themes/mindspike/functions.php on line 249”
My current code in my functions file:
add_action( ‘woocommerce_after_shop_loop_item’, ‘sm_display_product_color_options’, 9 );
function sm_display_product_color_options(){
global $woocommerce, $product;
$variation_colors_data = $product->get_attributes();
$variation_colors_data = $variation_colors_data[‘color’];
$variation_colors = $variation_colors_data[‘options’];echo “<div class=’product_colors_container’>”;
foreach ($variation_colors as $variation_color) {
$image = get_term_meta($variation_color,’image’,true);
$image = wp_get_attachment_image_src($image, ‘thumbnail’, false);
$image = $image[0];
echo ‘<span class=”swatch swatch-image”></span>’;
}
echo “</div>”;
}- This reply was modified 7 years, 3 months ago by Chris Cook.
Forum: Networking WordPress
In reply to: Multisite subdirectories cant edit pagesI found the issue was coming from using the Multisite Clone Duplicator plugin. Seems that any site I duplicate the new site will have this issue. If I manually create a site I will not have these issues.
Time to find a working multisite duplicator plugin.
Forum: Networking WordPress
In reply to: Multisite subdirectories cant edit pagesAnyone have any idea about these errors?
Forum: Fixing WordPress
In reply to: Flying Banner/Moving ImagesIf it is coded in the home page template you can duplicate it and re-name it, make edits, and use it for a different page as well.
Forum: Fixing WordPress
In reply to: ccs code to change color of “services” “CTA” and “footer”Also, make sure you are using a child theme for the CSS changes. Otherwise you will lose the changes upon updating.
Forum: Fixing WordPress
In reply to: ccs code to change color of “services” “CTA” and “footer”Use Google Chrome “inspect” to find the CSS to change. Here is the CSS for the header
.navbar-trans { background-color: #fff !important; } .navbar-nav > li > a { color: #000 !important; }
Forum: Developing with WordPress
In reply to: Change post title based on categoryTry this
function adddd($title) { if(has_category(30,$post->ID)){ $title = ‘Prefix ‘.$title; } return $title; } add_action(‘the_title’,’adddd’);