Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to insert verification codes to extendify theme - no header.php file #149

Open
Rolevents opened this issue Jun 26, 2024 · 4 comments
Open

Comments

@Rolevents
Copy link

-hi there. I'm not much of a programmer, but a digital marketer so please help me find the solution to insert different verification codes to the theme tags.
Usually I create a child theme for my client's wordpress websites and insert GTM and Facbook verification codes there so they will not be overwritten but I can't find one.
So how should I go about this? I have acces to theme files on the server. The setup was pretty easy through my server provider Zone.ee and I used some AI feature to set everything up. Looking good and I prefer to not go back to Astra + Elementor sh*t hahahaha.

Sry for the stupid question, but please guide me through it. ;)

@clubkert
Copy link
Member

Hi @Rolevents,

Thanks for reaching out. The Extendable theme is a block theme that uses the new Full Site Editing (FSE) technique, which is why there’s no header.php file. However, you can still insert verification codes into the site using the Extendable Child theme by adding the code to the functions.php file.

  1. Get the Extendable Child theme from here.
  2. Unzip the Extendable Child theme.
  3. Edit the functions.php file.
  4. Add this code snippet to the functions.php file:
function extendable_insert_custom_head_meta_and_scripts() {
    ?>
    <!-- Google Tag Manager -->
    <script>/* Your GTM code here */</script>
    <!-- End Google Tag Manager -->
    <!-- Facebook Verification -->
    <meta name=“facebook-domain-verification” content=“your_facebook_verification_code” />
    <?php
}
add_action(‘wp_head’, ‘extendable_insert_custom_head_meta_and_scripts’);
  1. Add your verification codes in the code you just added inside functions.php and save the file.
  2. Zip the Extendable Child theme file and upload it to the site:
    • Go to your WordPress dashboard.
    • Navigate to Appearance > Themes.
    • Click on Add New and then Upload Theme.
    • Upload the extendable-child.zip file you just created and activate the theme.

If you need further assistance, feel free to ask!

@Rolevents
Copy link
Author

Rolevents commented Jun 27, 2024 via email

@Rolevents
Copy link
Author

Rolevents commented Jul 9, 2024 via email

@clubkert
Copy link
Member

@Rolevents

I don't think there is a good way to export/import styles only, unfortunately.

If you've made a lot of changes and don't want to redo them, you could also consider using a plugin that allows you to insert the GTM and Facebook verification codes in the header. Then, you wouldn't have to use the child theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants