How do I create my own .php file with a code part and echo it on different pages?

There’s a fundamental misunderstanding here about how partials/templates that aren’t full pages/template fragments in WP work. get_* is not how files are loaded, and get_header and get_footer are special cases for legacy reasons, kept for conventions sake. They’re actually equivalent to: get_template_part( ‘header’ ); get_template_part( ‘footer’ ); But with some additional filters and checks so … Read more

Can’t remove DIV from hooks in Storefront child theme [closed]

Storefront version 3.0: Code of the header.php in version 3.0 <header id=”masthead” class=”site-header” role=”banner” style=”<?php storefront_header_styles(); ?>”> <?php /** * Functions hooked into storefront_header action * * @hooked storefront_header_container – 0 * @hooked storefront_skip_links – 5 * @hooked storefront_social_icons – 10 * @hooked storefront_site_branding – 20 * @hooked storefront_secondary_navigation – 30 * @hooked storefront_product_search – … Read more

get_template_part for specific page

This is just a supplement to the other answer. I am trying to load fd-blog.php if it is the ‘Blog’ page, otherwise load the fd-default.php To actually load the template file, you should remove the dash (-): get_template_part( ‘inc/fd’, ‘blog’ ); // loads inc/fd-blog.php get_template_part( ‘inc/fd’, ‘default’ ); // loads inc/fd-default.php So just inc/fd, and … Read more

get_search_form() and aria_label

You can pass an array of attributes with aria_label attribute in it. Try this: get_search_form(array(‘aria_label’ => ‘search-form’)); This function gets a form from searchform.php by default and if you have this file in your theme and aria-label still missing, you need to check the code in this file. Sometimes developers do not include an option … Read more

How to set a page as homepage in stead of the newspages?

please make yourself comfortable with the settings WordPress has to offer regarding your Homepage or Startpage as some call it. Those are not configured via that permalink setting of a specific page (as your image shows) but with options on the Settings Reading SubPanel (WordPress Codex). Probably Creating a Static Front Page (WordPress Codex) is … Read more

Redirect to another page using contact form 7? [closed]

Redirect to another page using contact form 7? [closed]