amandathewebdev
amandathewebdev

Reputation: 269

How to move woocommerce_ordering div below page-description on Woocommerce shop page?

I'm running into a problem with my site layout and any help would be appreciated! I am using Woocommerce and would like to move my woocommerce_ordering div to below the page-description div on my /shop/ page. I'm looking in /plugins/woocommerce/templates/archive-product.php and in theme/woocommerce/archive-product.php and I'm trying a few things with no luck.

I have a feeling it's this bit of code here that needs to be altered, but my changes make no difference. I add the changed file to my theme folder.

        <?php do_action( 'woocommerce_archive_description' ); ?>

    <?php if ( have_posts() ) : ?>

        <?php
            /**
             * woocommerce_before_shop_loop hook
             *
             * @hooked woocommerce_result_count - 20
             * @hooked woocommerce_catalog_ordering - 30
             */
            do_action( 'woocommerce_before_shop_loop' );
        ?>

        <?php woocommerce_product_loop_start(); ?>

            <?php woocommerce_product_subcategories(); ?>

            <?php while ( have_posts() ) : the_post(); ?>

                <?php wc_get_template_part( 'content', 'product' ); ?>

            <?php endwhile; // end of the loop. ?>

        <?php woocommerce_product_loop_end(); ?>

Upvotes: 0

Views: 1008

Answers (1)

amandathewebdev
amandathewebdev

Reputation: 269

Isn't it funny how you try a bajillion different things, but as soon as you ask a question you figure it out?

in my functions.php file I changed this:

if ( is_plugin_active('woocommerce/woocommerce.php') && ( is_shop()  ||  is_product_category() || is_product_tag() ) ) {
          add_action('woocommerce_before_main_content','woocommerce_catalog_ordering',20);
    remove_action('woocommerce_pagination','woocommerce_catalog_ordering',20);

    ?>

To this:

    <?php 
if ( is_plugin_active('woocommerce/woocommerce.php') && ( is_shop()  || is_product_category() || is_product_tag() ) ) {
    add_action('woocommerce_before_product_content','woocommerce_catalog_ordering',20);
    remove_action('woocommerce_pagination','woocommerce_catalog_ordering',20);

    ?>

where I changed woocommerce_before_main_content to woocommerce_before_product_content

Upvotes: 0

Related Questions