I would like to change the text (illustrated on the image below) from 'Portfolio Archives' to 'Shop'.
I have archive.php and portfolio.php files, none of which has any obvious indication of how/where to change the text.
screen shot http://damtech.it/screen.png
Your image link is broken...
But the title usually is in your header.php file.
I also come across this problem previous week.I was using a theme.This may help you or may not.But I face same problem ,so I am answering.
If you are using some theme.Then there should be your Theme Setting.
Go to theme setting and there will be Header and footer options.You may change this text from there.My problem was solved from there.
For anyone else who wasted time trying the approved answer, reading the function reference at https://codex.wordpress.org/Function_Reference/get_header and paying attention to this section:
Multiple Headers
Different header for different pages.
<?php
if ( is_home() ) :
get_header( 'home' );
elseif ( is_404() ) :
get_header( '404' );
else :
get_header();
endif;
?>
The file names for the home and 404 headers should be header-home.php and header-404.php respectively.
leads to the following successful approach.
Copy your (yourthemename)/header.php file to (yourthemename)/header-customname.php
Change the get_header() call in the file you are targeting to get_header('customname')
Job done.
Related
I am having problems with this code below :
<?php if ( $arts_menu_overlay_circle_contents === 'logo' ) : ?>
<?php get_template_part( 'template-parts/logo/logo' ); ?>
<?php endif; ?>
I want to set an custom logo but it automatically takes the logo.php part.
I want it to get an image like .jpg or .png
Anyone can help me ?
Thanks in advance!
If i understand you correctly and assume i know little wordpres (very little), i got this link https://developer.wordpress.org/reference/functions/get_template_part/.
There is described how you will be rewriting the template file of the logo, which is php file.
So inside this template file you have to change maybe the path to your logo.
First of all you don't need to come to code this soon while using WordPress. All modern themes comes with Theme Options or customize option where you can place your logo. That's your first options. So try to find Theme Options Menu on your Dashboard. Otherwise go to Appearance > Customize and see the Header option to change the logo.
get_template_part( 'template-parts/logo/logo' );
This refers to location template-parts -> logo -> logo.php inside your activated theme. So, appropreate solution will be create same folder and file in your child theme and change the code in logo.php to place your logo file directly.
Thanks All for supporting me . I have solved my problem by using a simple markup instead of php code that wordpress use.
The code markup is :
<img src="https://placehold.it/200x200" width="200" height="200" alt="" />
Thanks Again all of you.
In the theme check of my website I saw an error saying that the filter body_class was not found. I took a look at the support page of the plugin I´m using (https://support.fancyproductdesigner.com/support/solutions/articles/5000582912-using-the-debug-mode-to-inspect-any-missing-hooks-in-woocommerce-product-pages) and it says:
Missing hook: body_class
If you are seeing this information instead of the Product Designer:
Sorry! But the product designer is not adapted for your device. Please use a device with a larger screen!
It means an important hook is missing in your theme. You need to add following code to the body HTML tag in the header.php your theme.
<body <?php body_class(); ?>>
I tried to add the code to the header.php file, which has this content:
<?php
// =============================================================================
// HEADER.PHP
// -----------------------------------------------------------------------------
// The site header.
// =============================================================================
x_get_view( 'header', 'base' );
But honestly, for some reasons it doesn´t help. Can someone show me which is the right way to do it?
Many thanks
Yeah, that was my thought. The script is in effect already there, but the theme says anyway, that the code is missing.
I am using Wordpress twenty sixteen theme in my project, but page content, not displaying on front site in WP-admin adds page and puts content and update my front site display code is now:
<?php while ( have_posts() ) : the_post(); get_template_part( 'content', 'page' ); ?><?php //comments_template( '', true ); ?><?php endwhile; ?>
Content not showing up can be due to a few issues, but without access to your site, it's nearly impossible to be sure.
Here are a few things to try:
Disable all plugins to make sure none of them are interfering with your site. If your site reappear, Deena Le them one by one to see which one is causing the problems.
Reset permalink in setting to "plain" to see whether you've configured your site properly
Your PHP version may be too low (upgrade) or the pcre.backtrack_limit is set to 100000. In order to check, create a phpinfo.php file with this
code:
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>
And then navigate to it in your browser.
If it's low, create a php.ini file or edit the existing one and modify or add the line pcre.backtrack_limit=1000000
Check in setting->reading you're showing your latest posts (and make sure you have at least one post published (not draft). If that is the problem, and you want to show a static page, you may have a problem with the static page.
Make sure you have the latest version of Wordpress installed.
Rename your theme folder in FTP from twentysixteen to twentysixteen-temp to make sure it's not the theme.
I have a custom page template created. When I load my page, it shows the header logo of the mainpage but what I want to achieve is for each custom template created, I want it to only show its own logo.
This is the bit of the header code that calls the logo.php file:
<?php get_template_part('parts/logo', 'top') ?>
This is what I have tried but not working
<?php if ( is_page('custom-page')) {
get_template_part ('parts/custom-logo', 'top');
} else {
get_template_part('parts/logo', 'top');
} ?>
Any help will be much appreciated.
Thanks
OK I figured it out :). Not sure if this was an error from the owner of the Theme but in the header file, the logo bit was called like this get_template_part('parts/logo', 'top'); but when I checked the folder parts the actual file name was logo.php but I was expecting to see logo-top.php. That was a bit misleading to me but I might be wrong
So what I simply did was rename my custom-logo.php to custom-logo-top.php and that fixed the problem.
In fact I also tried this without renaming the file by replacing top with logo and it still worked:
<?php if ( is_page('custom-page')) {
get_template_part ('parts/custom', 'logo');
} else {
get_template_part('parts/logo', 'top');
} ?>
I've been looking around for a while on how to do this but I don't think I've been wording my searches correctly. I'm developing a custom theme and want to break out a section of a page into a reusable piece that I can reference like you would insert a header with <?php get_header(); ?> but I want to use a different header file instead of header.php. How would I do this?
You can use the function like this:
<?php get_header( $name ); ?>
$name :: (string) (optional) Calls for header-name.php.
if you have a seperate header for home page you can create a header file like this "header-home.php" to call that header file use the get_header function like this:
<?php get_header( 'home' ); ?>
Also you can call multipe header in a theme like this according to different conditions
<?php
if ( is_home() ) :
get_header( 'home' );
elseif ( is_404() ) :
get_header( '404' );
else :
get_header();
endif;
?>
You can specify which header file you want to use by naming it, as Ajith R Nair said in his answer. <?php get_header('new');?> would load the file header-new.php in your theme's directory. If you plan on changing small parts of your header, I suggest not using duplicate header files, but instead define a global variable that holds an array of default parameters in the header file, and just use that same global variable in your theme pages to override defaults. Hopefully that points you in the right direction, though I would be happy to clarify if needed.