SU Mike
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Move variations on top of short description// relocate add to cart variable box above product excerpt add_action( 'init', 'jk_edit_woocommerce_single_product_summary' ); function jk_edit_woocommerce_single_product_summary() { remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 19 ); }
The Add to Cart Block is Wrapped up with the Variable selections, if you just move that whole block above the excerpt it will do what you want. You can also target specific parts of the page and reorganize their layout using the same code. If you’d like to see how all the elements are ordered and try to reorder them further yourself using the code above just go here. . .
woocommerce/templates/content-single-product.php
- This reply was modified 4 years, 9 months ago by SU Mike.
What’s this white space that you speak of?
I’ve narrowed my issue down, when I edit the function.php code in my ‘Microsoft expression’ local web editor and upload it online it causes the error, but if I acces the function.php file direction through the admin panel and add the secondary-widget code and update it works just fine.
I might have unknowingly run into this same issue in the past and worked my way around it so it is a relief to figure out, but I’m still curious as to what the ‘white space’ is as I haven’t touched anything in my beginning of my code and I need to know if my editors causing it.
all I see is. . . .
<?php
add_action( ‘after_setup_theme’, ‘blankslate_setup’ );
function blankslate_setup()which looks standard
p.s. Thanks for your help thus far Mike! first time I’ve reached out for help and glad to know someone’s out there! ??
I created this test page, but i’m not sure how to share a .php page for viewing? Does this work? https://www.silveradotruckaccessories.com/testpage.htm
?<?php
add_action( ‘after_setup_theme’, ‘blankslate_setup’ );
function blankslate_setup()
{
load_theme_textdomain( ‘blankslate’, get_template_directory() . ‘/languages’ );
add_theme_support( ‘automatic-feed-links’ );
add_theme_support( ‘post-thumbnails’ );
global $content_width;
if ( ! isset( $content_width ) ) $content_width = 640;
register_nav_menus(
array( ‘main-menu’ => __( ‘Main Menu’, ‘blankslate’ ) )
);
}
add_action( ‘wp_enqueue_scripts’, ‘blankslate_load_scripts’ );
function blankslate_load_scripts()
{
wp_enqueue_script( ‘jquery’ );
}
add_action( ‘comment_form_before’, ‘blankslate_enqueue_comment_reply_script’ );
function blankslate_enqueue_comment_reply_script()
{
if ( get_option( ‘thread_comments’ ) ) { wp_enqueue_script( ‘comment-reply’ ); }
}
add_filter( ‘the_title’, ‘blankslate_title’ );
function blankslate_title( $title ) {
if ( $title == ” ) {
return ‘→’;
} else {
return $title;
}
}
add_filter( ‘wp_title’, ‘blankslate_filter_wp_title’ );
function blankslate_filter_wp_title( $title )
{
return $title . esc_attr( get_bloginfo( ‘name’ ) );
}
add_action( ‘widgets_init’, ‘blankslate_widgets_init’ );
function blankslate_widgets_init()
{
register_sidebar( array (
‘name’ => __( ‘Sidebar Widget Area’, ‘blankslate’ ),
‘id’ => ‘primary-widget-area’,
‘before_widget’ => ‘<li id=”%1$s” class=”widget-container %2$s”>’,
‘after_widget’ => “”,
‘before_title’ => ‘<h3 class=”widget-title”>’,
‘after_title’ => ‘</h3>’,
) );
register_sidebar( array (
‘name’ => __( ‘Secondary Widget Area’, ‘blankslate’ ),
‘id’ => ‘secondary-widget-area’,
‘before_widget’ => ‘<li id=”%1$s” class=”widget-container %2$s”>’,
‘after_widget’ => “”,
‘before_title’ => ‘<h3 class=”widget-title”>’,
‘after_title’ => ‘</h3>’,
) );
}
function blankslate_custom_pings( $comment )
{
$GLOBALS[‘comment’] = $comment;
?>
<li <?php comment_class(); ?> id=”li-comment-<?php comment_ID(); ?>”><?php echo comment_author_link(); ?><?php
}
add_filter( ‘get_comments_number’, ‘blankslate_comments_number’ );
function blankslate_comments_number( $count )
{
if ( !is_admin() ) {
global $id;
$comments_by_type = &separate_comments( get_comments( ‘status=approve&post_id=’ . $id ) );
return count( $comments_by_type[‘comment’] );
} else {
return $count;
}
}also to mention, I simply cannot erase the secondary_widget code in the function.php file and have it go back to normal even though I reverted it to where i started, I’m having to overwrite the online function.php file with a local copy in order to make the error go away, I don’t get that.
<?php
add_action( ‘after_setup_theme’, ‘SilveradoTA_setup’ );
function SilveradoTA_setup()
{
load_theme_textdomain( ‘SilveradoTA’, get_template_directory() . ‘/languages’ );That’s how it starts, I’m starting with a clean ‘blankslate’ template and basic css and the only thing I’m adding to the function.php is the secondary register-sidebar( array(. . . . . . .It works on my local server just fine without a problem so I don’t know what to chase.
add_action( ‘widgets_init’, ‘SilveradoTA_widgets_init’ );
function SilveradoTA_widgets_init()
{
register_sidebar( array (
‘name’ => __( ‘Sidebar Widget Area’, ‘SilveradoTA’ ),
‘id’ => ‘primary-widget-area’,
‘before_widget’ => ‘<li id=”%1$s” class=”widget-container %2$s”>’,
‘after_widget’ => “”,
‘before_title’ => ‘<h3 class=”widget-title”>’,
‘after_title’ => ‘</h3>’,
) );
register_sidebar( array (
‘name’ => __( ‘Secondary Widget Area’, ‘SilveradoTA’ ),
‘id’ => ‘secondary-widget-area’,
‘before_widget’ => ‘<li id=”%1$s” class=”widget-container %2$s”>’,
‘after_widget’ => “”,
‘before_title’ => ‘<h3 class=”widget-title”>’,
‘after_title’ => ‘</h3>’,
) );
}