• For my Product Archive template, I’m trying to ‘unhook’ the page title or archive title to move it (along w/ the breadcrumbs and archive description) to a full page-width section above the products loop.

    I was able to use:

    remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 );
    remove_action( 'woocommerce_archive_description', 'woocommerce_product_archive_description', 10);

    to unhook those functions and add them back inside a custom function that does this, but I cannot figure out how to move the title w/ them. When I use the woocommerce_page_title filter to return false, the title goes away, but since I can’t seem to find what hook that filter is tied to ANYWHERE, I’m kind of stuck. When I add the genesis_do_post_title back in, it gives me the title of the first item pulled in the loop… is there any way to reposition the archive title much like w/ default genesis pages on a woocommerce template page?

Viewing 1 replies (of 1 total)
  • Thread Starter thoughtwell

    (@thoughtwell)

    Okay, so instead of all of this, I ended up finding the genesiswooc_product_archive and genesiswooc_content_product functions (thanks, hookr.io) in the template-loader.php file within the plugin and copying those functions over to my template.

    I then removed the title and archive description output from both those, then renamed them and stuck the revised functions into my template page where the OG code went. Since this is where the title and description are declared and that bit was removed, there’s no need to remove the action responsible for this higher up in the template, so I deleted those.

    Because I renamed the functions, I don’t have to worry about updates to the plugin effecting this, but I guess I will need to keep tabs on any major changes to woocommerce and adjust my code as needed down the road.

    A simple idea of how to remove the title through a hook like I’m able to do w/ the description would have been ideal to do what I wanted to do, but since that information wasn’t forthcoming (I’m kind of a novice, here), this solution will seem to do unless someone else can fill me on how that title is hooked into the page, since as a filter, all I was able to do was return false, and I didn’t want to completely take the title away.

    • This reply was modified 9 years, 3 months ago by thoughtwell. Reason: made easier to read
Viewing 1 replies (of 1 total)

The topic ‘Move Product Archive Title’ is closed to new replies.