• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Move page title to another hook in WooCommerce

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Move page title to another hook in WooCommerce

This topic is: resolved

Tagged: entry-title, reposition title, WooCommerce

  • This topic has 5 replies, 3 voices, and was last updated 5 years, 3 months ago by Brad Dalton.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • January 26, 2017 at 12:33 pm #200081
    hmistler
    Member

    Hello - I'm trying to make my page title on my WooCommerce shop page the same design as all my other pages, but using Action Hooks plugin I notice WooCommerce puts the page title in the "before_loop", whereas I need it to be in the "after_header" hook. How can I move this? Ideally would like to add a line to my functions.php file, but just not sure of the right code for this. Thanks!

    https://mossandblue.com/shop/
    January 26, 2017 at 1:51 pm #200085
    hmistler
    Member

    *Update*

    Here is the part of the code in the archive_product page that comes with WooCommerce and controls the shop page, if it helps:

    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly
    }
    
    get_header( 'shop' ); ?>
    
    	<?php
    		/**
    		 * woocommerce_before_main_content hook.
    		 *
    		 * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
    		 * @hooked woocommerce_breadcrumb - 20
    		 */
    		do_action( 'woocommerce_before_main_content' );
    	?>
    
    		<?php if ( apply_filters( 'woocommerce_show_page_title', true ) ) : ?>
    
    			<h1 class="page-title"><?php woocommerce_page_title(); ?></h1>
    
    		<?php endif; ?>
    
    		<?php
    			/**
    			 * woocommerce_archive_description hook.
    			 *
    			 * @hooked woocommerce_taxonomy_archive_description - 10
    			 * @hooked woocommerce_product_archive_description - 10
    			 */
    			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' );
    			?>
    January 26, 2017 at 5:49 pm #200092
    Victor Font
    Moderator

    You can't change this through an action hook because the title code is not being rendered in a hook. It's hard coded in the template. You can copy the template into your child theme's woocommerce directory and move the title in the template.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    January 26, 2017 at 5:55 pm #200093
    hmistler
    Member

    Ok...how would I move the title in the template?

    January 26, 2017 at 6:41 pm #200094
    Victor Font
    Moderator

    Cut and paste the code surrounding the woocommerce_page_title() function.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    January 27, 2017 at 10:15 pm #200156
    Brad Dalton
    Participant

    Might be wrong because i haven't tested these solutions however:

    1. You can use a filter function in your child themes functions file.

    Or

    2. You can remove the page title and then add it back using any of the genesis or woocommerce hooks.

    Try this in your child theme's functions:

    add_filter( 'woocommerce_show_page_title', false );
    

    You could also use this code conditionally.


    2700 Genesis Tutorials

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Move page title to another hook in WooCommerce’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2022 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble