Developer – XTRA Tutorials https://xtratheme.com/docs Documentation of XTRA WordPress Theme Fri, 20 Sep 2024 18:00:33 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.2 How to Find and Edit header.php or footer.php in Theme? https://xtratheme.com/docs/how-to/how-to-find-and-edit-header-php-or-footer-php-in-theme/ https://xtratheme.com/docs/how-to/how-to-find-and-edit-header-php-or-footer-php-in-theme/#respond Tue, 10 Sep 2024 12:49:57 +0000 https://xtratheme.com/docs/?p=4170

Description

Step 1
Xtra

Editing header.php and footer.php

In WordPress, the header.php and footer.php files are part of the theme files responsible for displaying your site’s header and footer sections. Here’s how you can locate and edit these files:

Steps to Find header.php or footer.php:

1. Via WordPress Dashboard:

  • Go to your WordPress Dashboard.
  • Navigate to Appearance > Theme File Editor.
  • On the right-hand side, you will see a list of theme files. Look for header.php or footer.php under Theme Files.
  • Click on the file you want to view or edit.

2. Via FTP or Hosting File Manager:

  • Access your website files through FTP (using a client like FileZilla) or through your hosting provider’s File Manager.
  • Go to the /wp-content/themes/ directory.
  • Open the folder of the active theme you are using.
  • Find header.php and footer.php files and download or edit them.

Important Tip: Avoid Directly Editing header.php and footer.php

While it is possible to edit header.php and footer.php directly, it is not recommended because any custom changes will be overwritten when the theme is updated. Instead, you should use WordPress action hooks like wp_body_open() and wp_footer() to add custom code.

]]>
https://xtratheme.com/docs/how-to/how-to-find-and-edit-header-php-or-footer-php-in-theme/feed/ 0
What is the generate_page() Function in Theme? https://xtratheme.com/docs/developer/what-is-the-generate_page-function-in-theme/ https://xtratheme.com/docs/developer/what-is-the-generate_page-function-in-theme/#respond Tue, 10 Sep 2024 10:39:14 +0000 https://xtratheme.com/docs/?p=4167

Description

Step 1
Xtra

The theme generate_page() function

The generate_page() function in our WordPress theme is not a default or built-in function from WordPress and its premium function to generate all pages in our theme. Only way to edit it is using theme functions.php file and we do not recommend it, because you will lose your changes after any theme and plugins updates.

 

If you want to edit any part of it, We recommend you use WordPress and theme built-in filters and actions. For example if you want to edit content, you can use WordPress the_content filter. If you want to edit or add something before or after any sections in pages, single posts, products, etc. We recommend you first check Developer posts from top menu, if you can’t find your solution then ask it from chatGPT, it will give you a WordPress filter or action for this purpose.

]]>
https://xtratheme.com/docs/developer/what-is-the-generate_page-function-in-theme/feed/ 0
codevz/option/key https://xtratheme.com/docs/developer/codevz-option-key/ https://xtratheme.com/docs/developer/codevz-option-key/#respond Wed, 26 Jun 2024 09:28:36 +0000 https://xtratheme.com/docs/?p=2682

Example code

Step 1
XTRA

Using WordPress filter to modify any theme options value

In the following example you can see how to change site logo image URL only on home page of your website, Other pages will get logo from theme options.

In filter name you can change xtra/option/logo to modify another option, for example for modifying layout value, try xtra/option/layout and return your value.

HOW

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

HOW

How to find any theme options key?

In the below screenshot, you can see how to find site width option key. First open your customizer page then find your option and then open your browser inspect element feature to find the input name or data-depent-id attribute. Exactly like below shot you can find key. For site width key is site_width

How to find customizer field id min
]]>
https://xtratheme.com/docs/developer/codevz-option-key/feed/ 0
codevz/importer/after_import_slider https://xtratheme.com/docs/developer/codevz-importer-after_import_slider/ https://xtratheme.com/docs/developer/codevz-importer-after_import_slider/#respond Wed, 19 Jun 2024 12:03:49 +0000 https://xtratheme.com/docs/?p=3076

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to run your custom PHP codes after importing slider from demo importer side.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-importer-after_import_slider/feed/ 0
codevz/importer/after_import_content https://xtratheme.com/docs/developer/codevz-importer-after_import_content/ https://xtratheme.com/docs/developer/codevz-importer-after_import_content/#respond Wed, 19 Jun 2024 11:58:32 +0000 https://xtratheme.com/docs/?p=3070

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to run your custom PHP codes after importing content from demo importer side.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-importer-after_import_content/feed/ 0
codevz/importer/after_import_widgets https://xtratheme.com/docs/developer/codevz-importer-after_import_widgets/ https://xtratheme.com/docs/developer/codevz-importer-after_import_widgets/#respond Wed, 19 Jun 2024 11:38:18 +0000 https://xtratheme.com/docs/?p=3067

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to run your custom PHP codes after importing widgets from demo importer side.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-importer-after_import_widgets/feed/ 0
codevz/importer/after_import_theme_options https://xtratheme.com/docs/developer/codevz-importer-after_import_theme_options/ https://xtratheme.com/docs/developer/codevz-importer-after_import_theme_options/#respond Wed, 19 Jun 2024 11:28:38 +0000 https://xtratheme.com/docs/?p=3064

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to modify imported theme options array.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-importer-after_import_theme_options/feed/ 0
codevz/after_footer_2 https://xtratheme.com/docs/developer/codevz-after_footer_2/ https://xtratheme.com/docs/developer/codevz-after_footer_2/#respond Wed, 19 Jun 2024 11:26:07 +0000 https://xtratheme.com/docs/?p=3059

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to add content or PHP codes after footer bottom bar.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-after_footer_2/feed/ 0
codevz/before_footer_2 https://xtratheme.com/docs/developer/codevz-before_footer_2/ https://xtratheme.com/docs/developer/codevz-before_footer_2/#respond Wed, 19 Jun 2024 10:46:28 +0000 https://xtratheme.com/docs/?p=3044

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to add content or PHP codes before footer bottom bar.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-before_footer_2/feed/ 0
codevz/after_footer_1 https://xtratheme.com/docs/developer/codevz-after_footer_1/ https://xtratheme.com/docs/developer/codevz-after_footer_1/#respond Tue, 18 Jun 2024 11:50:55 +0000 https://xtratheme.com/docs/?p=3024

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to add content or PHP codes after footer top bar.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-after_footer_1/feed/ 0
codevz/before_footer_1 https://xtratheme.com/docs/developer/codevz-before_footer_1/ https://xtratheme.com/docs/developer/codevz-before_footer_1/#respond Tue, 18 Jun 2024 11:42:27 +0000 https://xtratheme.com/docs/?p=3020

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to add content or PHP codes before footer top bar.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-before_footer_1/feed/ 0
codevz/after_header_4 https://xtratheme.com/docs/developer/codevz-after_header_4/ https://xtratheme.com/docs/developer/codevz-after_header_4/#respond Tue, 18 Jun 2024 11:39:50 +0000 https://xtratheme.com/docs/?p=3015

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to add content or PHP codes after mobile and tablet header.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-after_header_4/feed/ 0
codevz/before_header_4 https://xtratheme.com/docs/developer/codevz-before_header_4/ https://xtratheme.com/docs/developer/codevz-before_header_4/#respond Tue, 18 Jun 2024 11:36:30 +0000 https://xtratheme.com/docs/?p=3012

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to add content or PHP codes before mobile and tablet header.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-before_header_4/feed/ 0
codevz/after_header_3 https://xtratheme.com/docs/developer/codevz-after_header_3/ https://xtratheme.com/docs/developer/codevz-after_header_3/#respond Tue, 18 Jun 2024 11:31:22 +0000 https://xtratheme.com/docs/?p=3009

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to add content or PHP codes after header bottom bar.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-after_header_3/feed/ 0
codevz/before_header_3 https://xtratheme.com/docs/developer/codevz-before_header_3/ https://xtratheme.com/docs/developer/codevz-before_header_3/#respond Tue, 18 Jun 2024 11:26:54 +0000 https://xtratheme.com/docs/?p=3006

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to add content or PHP codes before header bottom bar.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-before_header_3/feed/ 0
codevz/after_header_2 https://xtratheme.com/docs/developer/codevz-after_header_2/ https://xtratheme.com/docs/developer/codevz-after_header_2/#respond Tue, 18 Jun 2024 11:16:58 +0000 https://xtratheme.com/docs/?p=3001

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to add content or PHP codes after main header.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-after_header_2/feed/ 0
codevz/before_header_2 https://xtratheme.com/docs/developer/codevz-before_header_2/ https://xtratheme.com/docs/developer/codevz-before_header_2/#respond Tue, 18 Jun 2024 11:10:37 +0000 https://xtratheme.com/docs/?p=2997

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to add content or PHP codes before main header.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-before_header_2/feed/ 0
codevz/after_header_1 https://xtratheme.com/docs/developer/codevz-after_header_1/ https://xtratheme.com/docs/developer/codevz-after_header_1/#respond Tue, 18 Jun 2024 11:08:02 +0000 https://xtratheme.com/docs/?p=2994

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to add content or PHP codes after header top bar.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-after_header_1/feed/ 0
codevz/before_header_1 https://xtratheme.com/docs/developer/codevz-before_header_1/ https://xtratheme.com/docs/developer/codevz-before_header_1/#respond Tue, 18 Jun 2024 11:04:52 +0000 https://xtratheme.com/docs/?p=2987

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to add content or PHP codes before header top bar.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-before_header_1/feed/ 0
codevz/after_fixed_side_1 https://xtratheme.com/docs/developer/codevz-after_fixed_side_1/ https://xtratheme.com/docs/developer/codevz-after_fixed_side_1/#respond Tue, 18 Jun 2024 10:57:09 +0000 https://xtratheme.com/docs/?p=2984

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to add content or PHP codes after fixed side.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

]]>
https://xtratheme.com/docs/developer/codevz-after_fixed_side_1/feed/ 0