Shop Categories

X

Syntax of functions.php in Agama Child theme

Home Forums Agama Pro Syntax of functions.php in Agama Child theme

Topic Resolution: Resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6078
    ov
    Participant

    I try to remove the sort order drop-down in WOOCommerce by adding a remove_action call at the end of functions.php:
    remove_action( ‘woocommerce_before_shop_loop’, ‘woocommerce_catalog_ordering’, 30 );
    It does not work.

    When I compared the syntax seems to be different in the Agama child functions.php.

    The functions.php examples I found start with <?php and end with ?>.

    In the Agama child functions.php the end tag ?> is missing.

    Is my problem related to that? If I add the ?> tag it does not work at all.

    Thanks in advance,
    Martin

    • This topic was modified 5 years, 3 months ago by ov.
    #6082
    Jerry
    Keymaster

    Hello Martin,

    Omitting PHP close tag is common practice using by many developers.

    Omitting the closing tag is just one solution for avoiding blanks and other characters at the end of file. For example any char which is accidentally added behind the closing tag would trigger an error when trying to modify header info later.

    Omitting the closing tag is kind of “good practice” referring to many coding guidelines.

    For removing products filter you have in-build theme option to disable it, just go to:
    Appearance -> Customize -> WooCommerce -> Products Filter -> Off

    Best Regards

    #6088
    ov
    Participant

    The in-build theme option will remove all filters, not only the sort dropdown. I wanted to remove all, so I am fine.
    Thank you for quick help.
    Martin

    #6091
    Jerry
    Keymaster

    I’m glad i could assist 😉

    Regards

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.