PHP in der Datei functions.php:
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 ); add_action( 'woocommerce_before_single_product_summary', 'woocommerce_template_single_title', 5 ); remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 6 ); add_action( 'woocommerce_before_single_product_summary', 'woocommerce_template_single_price', 6 ); remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 30 ); add_action( 'woocommerce_before_single_product_summary', 'woocommerce_template_single_excerpt', 10 ); remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 6 ); add_action( 'woocommerce_before_single_product_summary', 'woocommerce_template_single_add_to_cart', 6 );
Ich schaffte es, den Titel, den Preis, den Auszug und den Einkaufswagen vor den Bildern zu verschieben, so dass ich nun die Seite wie folgt eingerichtet habe und es ist, was ich will. Aber ich möchte ein div mit der class “mobile-summary” um den ersten Satz.
Preis
Auszug
in den Warenkorb legen
Ich weiß nicht, wie es heißt, also nichts. Ich lerne Genesis und Woocommerce ohne viel Erfahrung in PHP oder WordPress (sogar Bloggen als Benutzer).
Ich habe dasselbe auf eine andere Art und Weise gemacht und jetzt ist es so gestapelt, wie ich es möchte, mit einem div, der den Inhalt einhüllt.
Dies stapelt den einzelnen Produkt-Woocommerce-Output wie folgt:
Auf großen Viewports schweben wir nun die .product div.images nach links, schweben die .product div.summary nach rechts, löschen das Zeug danach. Verstecken Sie den Footer-Cart-Bereich in großen Ansichtsfenstern und die Person auf einem Mobiltelefon muss nicht mehr die gesamte Höhe des Bildes scrollen, um sie in den Warenkorb zu legen – wenn sie es wünschen.
In den functionen.php
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { // ==== wrap in div function output_opening_div() { echo '
'; } // ==== put the excerpt below the add to cart and before the meta remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_excerpt',20); add_action('woocommerce_single_product_summary', 'woocommerce_template_single_excerpt',35); // ==== move images (with the thumbs) below the content remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 ); add_action( 'woocommerce_after_single_product_summary', 'woocommerce_show_product_images', 50); // ==== move all the content after images remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 ); remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 ); remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 ); add_action( 'woocommerce_after_single_product', 'woocommerce_output_product_data_tabs', 20); add_action( 'woocommerce_after_single_product', 'woocommerce_upsell_display', 20); add_action( 'woocommerce_after_single_product', 'woocommerce_output_related_products', 20 ); // ==== repeat cart after image with opening and closing div functions add_action('woocommerce_after_single_product','output_opening_div',9); add_action( 'woocommerce_after_single_product', 'woocommerce_template_single_price', 10 ); add_action( 'woocommerce_after_single_product', 'woocommerce_template_single_add_to_cart', 10 ); add_action('woocommerce_after_single_product','ouput_closing_div',10); }// end if woocommerce
Ich würde es mit jQuery machen, etwas wie:
$('.element').wrapInner('');
.element muss das Div sein, bevor Sie den Code verwenden möchten, z
Ohne eine URL zu arbeiten, ist es schwer, eine 100% ige Antwort zu geben, aber das wird Ihnen einen Ausgangspunkt geben