[Resolved] Hook rules

Home Forums Support [Resolved] Hook rules

Home Forums Support Hook rules

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #941507
    Sebastien

    Hi,

    1)I try to make a hook directly into function.php file:

    add_action( 'generate_after_header ','example_function_name' );  
    function example_function_name() { ?> 
        Insert your hook contents in here.
    <?php }

    I would like to add 2 rules :
    – Location rule: Entire Site
    – Exclusion rule: Front Page

    2) Another solution I would like to be able to do is to add add Filter / hook to an existing GP Element Hook, by using the ID of the element. That would able me to keep using the GP UI to define rules and using php file to manage the content.. But I also wonder about speed performence of this case (compared to the first case)?

    thanks for any help !

    #941562
    David
    Staff
    Customer Support

    Hi there,

    1. you would use WP conditional tags in your PHP:

    https://docs.generatepress.com/article/using-hooks-conditional-tags/

    2. I am not sure the reasoning for doing this, but i can’t see that being possible. The display rules you set on an element are just including the necessary conditional tags for that content.

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