• Hi,
    I’m trying to change the order of elements on the page and overall customize the page. For example, right now without a logo, the name of the site shows and I don’t see a way to remove it. I have multiple paragraphs also that only the Additional content allows me to use to have some kind of formatting but I want it before the buttons and not after.
    I see that age-gate-form.php is exactly what I’d want to modify but is there a way to override that instead of never be able to update the plugin if I start changing the core files?
    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Phil

    (@philsbury)

    Hi @altgirlmedia,

    Short answer is yes – if you’re on v3+. You can copy any files to your theme in an age-gate folder and do what you like with them. So for that file:

    <theme dir>/age-gate/partials/age-gate-form.php

    It uses a template system and will pass a load of data to the view files.

    Having said that, might be easier to just add stuff in with the hooks that exist already. Let’s say you want content before the buttons, then this would do it:

    
    add_action('age_gate/custom/before', function() {
      ?>
      Add your content here
      <?php
    });
    

    You could also use age_gate/fields with a priority lower than 10.

    For the title, its applied with an action, so can just remove the action:

    remove_action('age_gate/logo', 'age_gate_template_logo');

    There’s a list of the actions in the docs, they just don’t have any descriptions yet was time disappears!

    Lastly if you need extra css classes or anything, you can do that too; For example, add a class to the form element:

    age_gate_add_attribute('age-gate-form', 'class', 'my-class')

    Which each element being called `age-gate-*something*.

    Hope that helps!

    Thanks
    Phil

    Thread Starter altgirlmedia

    (@altgirlmedia)

    Awesome thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom template’ is closed to new replies.