Removing title from pages on child theme
-
How do I remove the title from showing on certain pages and can I get rid of the large space before my first line of text on my pages? https://www.travelbuddytrips.com
Please note, this will be my first time making changes using my child theme but I’m not sure if it is setup correctly. I activated my child theme and my site looks fine but I noticed when I view my css style sheet, it only has the template that I originally put in to create it:
/*
Theme Name: adventurous-child
Template: adventurous
Version: 1.0
Updated: 2014-09-19 11:23:13
*/@charset “UTF-8”;
@import url(‘../adventurous/style.css’);I thought it was supposed to import the info. from the parent file?
Thank you
-
1) ‘How do I remove the title from showing on certain pages?’
You can create a custom page template in your child theme (leaving out the page title) and use that template only on certain pages. See the Custom Page Template section on this page.
2) ‘can I get rid of the large space before my first line of text?’
You seem to have extra HTML code within your pages content areas, such as extra <html>, <body> and <meta> tags, which should not be there at all.
For example, on your homepage this appears before the first line of text in your bullet list –
<p><html></p> <p><meta name="description" content="Travel Buddy Trips is for solo travelers who want to visit other countries and view amazing sites, but would prefer not to travel alone. We help them by organizing unforgettable private tours to popular international destinations with other solo travelers who value travel as much as they do."/><br /> <meta name="keywords" content="touring companions, traveling companion, travelling alone, travel buddy, traveling alone, solo traveler, find travel companions, find travel buddies, travel companion wanted, travel buddies, travel companions, traveling companions, traveling solo, travel companion, vacations for singles, fina a travel buddy, travel mate, trip buddy, solo travel, trip together, singles travel, travel clubs, travel alone, travel solo, travel partner, travel partners, travel club, travel friends, travel groups, travel companion sites, solo travelers, find travel partner, find someone to travel with, find travel buddy, looking for a travel companion, looking for a travel partner, looking for a travel buddy, find travel companion, need travel companion, need travel partner, need travel buddy"/><br /> <meta name="robots" content="noarchive"/><br /> <body></p> <ul> <li> <p style="font-size: 200%;font-family: 'arial';">Do you dream of traveling to other countries?</p> </li>...............
You need to remove the extra code. Using the text editor to edit your homepage, the first line should start where
- begins, i.e.
<ul> <li> <p style="font-size: 200%;font-family: 'arial';">Do you dream of traveling to other countries?</p> </li>...............
Note that <html> and <body> can only be declared once on a webpage.
These are already declared in your header.php file so should never be added in the content area of your page. Likewise <meta> tags belong in the <head> section. To have custom meta tags for individual pages you can use a plugin such as All in One SEO Pack3) ‘I thought it was supposed to import the info. from the parent file?’
The actual text from the parent theme style.css is not duplicated in your child theme style.css, but both parent and child theme stylesheets are linked to in your header file. CSS declarations you add to the child theme style.css will override the parent style.css.
1) Hmmm….yeah, even that custom page template doesn’t make sense since I don’t know what I would do once I create the template.
2)I’m really confused. I entered the <html>, <body> and <meta> tags because I thought they were all required but it sounds as if these are automatically being created in the header.php file?? I only took out that <head> tag because it was causing even more of a gap.
3)Thank you
*Correction. In regards to the space. After checking the home page source code, I do see the metas and line breaks right before your text. You should remove that.
Since creating page templates may be too advanced for you, then you can just use css to hide the specific titles. When you look at your source code via browser, you will notice the “body tag” uses different classes on every page. Just create the css based on that page id. e.g.:
To hide the title on home page place the following class on your style.css:
body.page-id-34 header.entry-header {display:none !important}
To hide the about us page:
body.page-id-154 header.entry-header {display:none !important}
Thank you for the css code! As for the space before, I’m still confused as this is what I see when I do a straight copy and paste. Is there somewhere else I should be going that’s putting in spaces I don’t see? Are you saying I should take out these metas below? I thought they were good for SEO? Thank you!
<html>
<title>Travel Buddy Trips – Bringing Dream Vacations & Solo Travelers Together</title>
<meta name=”description” content=”Travel Buddy Trips is for solo travelers who want to visit other countries and view amazing sites, but would prefer not to travel alone. We help them by organizing unforgettable private tours to popular international destinations with other solo travelers who value travel as much as they do.”/>
<meta name=”keywords” content=”touring companions, traveling companion, travelling alone, travel buddy, traveling alone, solo traveler, find travel companions, find travel buddies, travel companion wanted, travel buddies, travel companions, traveling companions, traveling solo, travel companion, vacations for singles, find a travel buddy, travel mate, trip buddy, solo travel, trip together, singles travel, travel clubs, travel alone, travel solo, travel partner, travel partners, travel club, travel friends, travel groups, travel companion sites, solo travelers, find travel partner, find someone to travel with, find travel buddy, looking for a travel companion, looking for a travel partner, looking for a travel buddy, find travel companion, need travel companion, need travel partner, need travel buddy”/>
<meta name=”robots” content=”noarchive”/>
<body>- <p style=”font-size: 200%;font-family: ‘arial’;”>Do you dream of traveling to other countries?</p>
It’s not on the header.php – that is fine. The metas are within the content and you have the <html> and <body> tags called twice. You’ll have to fix the markups https://validator.w3.org/check?uri=https://www.travelbuddytrips.com/
Sorry, to be a pain but that’s where I’m confused. What I posted above is all I see. I don’t see the tags in there twice or the extra spacing when I look at the code for each page. Is there somewhere else I should be looking?
Am I supposed to be going to a file to see this instead of just looking at the code that I in put for each page?
Yes, you have to check the files. Check page.php, index.php and single.php.
I don’t see anything:
Page.php
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other ‘pages’ on your WordPress site will use a
* different template.
*
* @package Catch Themes
* @subpackage Adventurous
* @since Adventurous 1.0
*/get_header(); ?>
<div id=”primary” class=”content-area”>
<div id=”content” class=”site-content” role=”main”><?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( ‘content’, ‘page’ ); ?>
<?php
//Getting data from Theme Options Panel and Meta Box
global $adventurous_options_settings;
$options = $adventurous_options_settings;// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || ‘0’ != get_comments_number() ) {
comments_template( ”, true );
} ?><?php endwhile; // end of the loop. ?>
</div><!– #content .site-content –>
</div><!– #primary .content-area –><?php get_sidebar(); ?>
<?php get_footer(); ?>Index.php
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: https://codex.www.ads-software.com/Template_Hierarchy
*
* @package Catch Themes
* @subpackage Adventurous
* @since Adventurous 1.0
*/get_header(); ?>
<div id=”primary” class=”content-area”>
<div id=”content” class=”site-content” role=”main”><?php if ( have_posts() ) : ?>
<?php adventurous_content_nav( ‘nav-above’ ); ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?><?php
/* Include the Post-Format-specific template for the content.
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( ‘content’, get_post_format() );
?><?php endwhile; ?>
<?php adventurous_content_nav( ‘nav-below’ ); ?>
<?php else : ?>
<?php get_template_part( ‘no-results’, ‘index’ ); ?>
<?php endif; ?>
</div><!– #content .site-content –>
</div><!– #primary .content-area –>
<?php get_sidebar(); ?>
<?php get_footer(); ?>single.php
<?php
/**
* The Template for displaying all single posts.
*
* @package Catch Themes
* @subpackage Adventurous
* @since Adventurous 1.0
*/get_header(); ?>
<div id=”primary” class=”content-area”>
<div id=”content” class=”site-content” role=”main”><?php while ( have_posts() ) : the_post(); ?>
<?php adventurous_content_nav( ‘nav-above’ ); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
//get_template_part( ‘content’, get_post_format() );
$postformat = ( get_post_format() ? get_post_format() : ‘single’ );
get_template_part( ‘content’, $postformat );
?><?php adventurous_content_nav( ‘nav-below’ ); ?>
<?php
//Getting data from Theme Options Panel
global $adventurous_options_settings;
$options = $adventurous_options_settings;
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || ‘0’ != get_comments_number() ) {
comments_template( ”, true );
}
?><?php endwhile; // end of the loop. ?>
</div><!– #content .site-content –>
</div><!– #primary .content-area –><?php get_sidebar(); ?>
<?php get_footer(); ?>Hello??
Your page.php file looks fine, it looks instead like you’re pasting unnecessary code into your page editor.
I don’t see the tags in there twice or the extra spacing when I look at the code for each page.
Have a look at the source code – go to your homepage in a browser, right click with your mouse on any blank area or text, and then click ‘View page source’. Around lines 168-172 you’ll see how tags are being repeated, along with extra paragraph tags which are adding blank spaces:
<p><html></p> <p><meta name="description" content="Travel Buddy Trips is for solo travelers who want to visit other countries and view amazing sites, but would prefer not to travel alone. We help them by organizing unforgettable private tours to popular international destinations with other solo travelers who value travel as much as they do."/><br /> <meta name="keywords" content="touring companions, traveling companion, travelling alone, travel buddy, traveling alone, solo traveler, find travel companions, find travel buddies, travel companion wanted, travel buddies, travel companions, traveling companions, traveling solo, travel companion, vacations for singles, find a travel buddy, travel mate, trip buddy, solo travel, trip together, singles travel, travel clubs, travel alone, travel solo, travel partner, travel partners, singles vacations, travel club, travel friends, travel groups, travel companion sites, solo travelers, find travel partner, find someone to travel with, find travel buddy, looking for a travel companion, looking for a travel partner, looking for a travel buddy, find travel companion, need travel companion, need travel partner, need travel buddy"/><br /> <meta name="robots" content="noarchive"/><br /> <body></p>
Next, in your WordPress admin area go to edit your homepage, but be sure to be in ‘Text’ mode (not Visual mode). Do you see the code quoted above? Can you copy and paste whatever is in your text editor box?
Sure. I could be blind but I don’t see any extra code for spaces. I even took out the <head> tags because that was causing more of a space.
<html>
<title>Travel Buddy Trips – Bringing Dream Vacations & Solo Travelers Together</title>
<meta name=”description” content=”Travel Buddy Trips is for solo travelers who want to visit other countries and view amazing sites, but would prefer not to travel alone. We help them by organizing unforgettable private tours to popular international destinations with other solo travelers who value travel as much as they do.”/>
<meta name=”keywords” content=”touring companions, traveling companion, travelling alone, travel buddy, traveling alone, solo traveler, find travel companions, find travel buddies, travel companion wanted, travel buddies, travel companions, traveling companions, traveling solo, travel companion, vacations for singles, find a travel buddy, travel mate, trip buddy, solo travel, trip together, singles travel, travel clubs, travel alone, travel solo, travel partner, travel partners, singles vacations, travel club, travel friends, travel groups, travel companion sites, solo travelers, find travel partner, find someone to travel with, find travel buddy, looking for a travel companion, looking for a travel partner, looking for a travel buddy, find travel companion, need travel companion, need travel partner, need travel buddy”/>
<meta name=”robots” content=”noarchive”/>
<body>- <p style=”font-size: 150%;color: #000; font-family: ‘arial’;”>Do you dream of traveling to other countries?</p>
- <p style=”font-size: 150%;color: #000; font-family: ‘arial’;”>Do you wish you had someone to travel with you?</p>
-
<p style=”font-size: 150%;color: #000; font-family: ‘arial’;”>Does the thought of traveling overseas by yourself make you uncomfortable?</p>
<div style=”width: 800px; line-height: 30px; background-color: #B4FA99; ; border: 1px solid blue; background-color: #b4fa99;”>
<h1 style=”font-size: 175%; line-height: 50px; background-color: #b4fa99; color: #000;font-family: ‘arial’;text-align: center;”>What is Travel Buddy Trips?:</h1><p style=”font-size: 150%; line-height: 40px; background-color: #b4fa99;text-align: justify;color: #000; font-family: ‘arial’;”>Travel Buddy Trips works with solo travelers who want to visit other countries and view amazing sites, but would prefer not to travel alone. We have partnered with reputable tour companies to offer amazing itineraries to popular international destinations. These tours are composed of other solo travelers who value travel as much as you do. [caption id="attachment_362" align="alignright" width="300"]<img src=”https://www.travelbuddytrips.com/wp-content/uploads/2014/09/Erikas-Camel-Ride-through-the-Sahara-Desert-Egypt-20081-300×168.jpg” alt=”Erika's Camel Ride through the Sahara Desert, Egypt 2008″ width=”300″ height=”168″ class=”size-medium wp-image-362″ /> Erika’s Camel Ride through the Sahara Desert, Egypt 2008[/caption]<span style=”font-size: 150%; line-height: 40px; background-color: #b4fa99;color: #000; text-align: justify;font-family: ‘arial’;”>As an experienced international traveler, owner, Erika Musser, combined her travel knowledge with her passion for helping solo travelers and created Travel Buddy Trips. Creating dream vacations for people who want travel companions is her expertise and she strives to exceed your expectations. Spending your hard earned money on this dream vacation will be well worth it! </span>
</p></div>
<h2 style=”font-size: 175%; line-height: 70px; color: #000;font-family: ‘arial’;text-align: center;”>Benefits Our Clients Experience:</h2>- <p style=”font-size: 150%;font-family: ‘arial’;color: #000; “>The trip of a lifetime since it is more fun to travel with other people.</p>
- <p style=”font-size: 150%;font-family: ‘arial’;color: #000; “>Cost savings since the room and other expenses (eg. taxi, food, etc.) can be shared with a travel buddy.</p>
-
<p style=”font-size: 150%;font-family: ‘arial’;color: #000; “>An increased feeling of safety knowing they won’t be by themselves.</p>
-
<p style=”font-size: 150%;font-family: ‘arial’;color: #000; “>Less stress since we do most of the planning.</p>
-
<p style=”font-size: 150%;font-family: ‘arial’;color: #000; “>Free time to explore in the various destinations.</p>
<span style=”font-size: 150%; line-height: 40px; text-align: justify;font-family: ‘arial’;color: #000; “>
Want to learn more? Please visit our “How It Works” page or contact us today and let the adventure begin!</span>Google+
<script>// < ![CDATA[
(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’); ga(‘create’, ‘UA-53951953-1’, ‘auto’); ga(‘require’, ‘displayfeatures’); ga(‘send’, ‘pageview’);
// ]]></script>
pinterest-a4631
</body></html>
Thanks for your quick response. Just to be completely sure we’re on the same page here (no pun intended). Did you get the code you pasted above by going to your Admin dashboard, then Pages > All Pages > Home > Edit then clicking on the Text mode tab and copying everything within the WYSIWYG text editing box?
NO really, thank yoiu for your quick response! I’m not sure where WYSIWYG is but I logged into WP, found the Home Page > Edit > changed to the “Text” tab, and copied everything in that box.
Thanks, that’s a big help, it confirms what I thought might be happening. I think the problem is you are trying to paste entire HTML pages directly into WordPress pages? I’ll try to briefly explain why that can’t be done.
Websites built with .html files are very tedious to maintain. For example, if you wanted to simply add a link to your main navigation menu, you would have to add the link code manually on every single .html page. And you would have to do that every time you wanted to change a common element repeated on all pages, such as a banner image, footer text, etc.
WordPress uses .php files to keep common, repeated elements – like header, footer, menus, sidebar – in separate files which are all linked and combined when viewed in a browser. This means that if you want to add a nav link or change your header image, you only need to make that change once and it will be included on all your pages.
When you create a WordPress page, it’s nothing like creating a .html page from scratch. All of the repeated elements like header, footer, sidebar and navigation are in separate files and will automatically be included. So basically when you create a WordPress page you should just enter the title, and in the text editor box only place the text / images unique to that page – what you want to appear after the title and before the footer.
So you should not paste <html>, <body>, <meta>, <title> or Google Analytics code into the text editor box of a WordPress page.
<html>, <body> and <title> are automatically generated and included in your header.php file.
For <meta> tags, yes they are important for SEO but this is the wrong place to put them. They belong in the <head> section which is outside the scope of the text editor. You will need to use a plugin like All in One SEO Pack which will dynamically include your <meta> tags in the <head> section.
Google Analytics code is also outside the scope of the page text editor and needs to go in the <head> section. It would be easiest to use a plugin for this.
In the text editing box of your Home page (in Text mode) you should delete everything there and insert the following:
<ul> <li> <p style="font-size: 150%;color: #000; font-family: 'arial';">Do you dream of traveling to other countries?</p> </li> <li> <p style="font-size: 150%;color: #000; font-family: 'arial';">Do you wish you had someone to travel with you?</p> </li> <li> <p style="font-size: 150%;color: #000; font-family: 'arial';">Does the thought of traveling overseas by yourself make you uncomfortable?</p> </li> </ul> <div style="width: 800px; line-height: 30px; background-color: #B4FA99; ; border: 1px solid blue; background-color: #b4fa99;"> <h1 style="font-size: 175%; line-height: 50px; background-color: #b4fa99; color: #000;font-family: 'arial';text-align: center;">What is Travel Buddy Trips?:</h1> <p style="font-size: 150%; line-height: 40px; background-color: #b4fa99;text-align: justify;color: #000; font-family: 'arial';">Travel Buddy Trips works with solo travelers who want to visit other countries and view amazing sites, but would prefer not to travel alone. We have partnered with reputable tour companies to offer amazing itineraries to popular international destinations. These tours are composed of other solo travelers who value travel as much as you do. <div id="attachment_362" style="width: 310px" class="wp-caption alignright"><a href="https://www.travelbuddytrips.com/wp-content/uploads/2014/09/Erikas-Camel-Ride-through-the-Sahara-Desert-Egypt-20081.jpg"><img src="https://www.travelbuddytrips.com/wp-content/uploads/2014/09/Erikas-Camel-Ride-through-the-Sahara-Desert-Egypt-20081-300x168.jpg" alt="Erika's Camel Ride through the Sahara Desert, Egypt 2008" width="300" height="168" class="size-medium wp-image-362" /></a><p class="wp-caption-text">Erika’s Camel Ride through the Sahara Desert, Egypt 2008</p></div><span style="font-size: 150%; line-height: 40px; background-color: #b4fa99;color: #000; text-align: justify;font-family: 'arial';">As an experienced international traveler, owner, Erika Musser, combined her travel knowledge with her passion for helping solo travelers and created Travel Buddy Trips. Creating dream vacations for people who want travel companions is her expertise and she strives to exceed your expectations. Spending your hard earned money on this dream vacation will be well worth it! </span> </p> </div> <h2 style="font-size: 175%; line-height: 70px; color: #000;font-family: 'arial';text-align: center;">Benefits Our Clients Experience:</h2> <ul> <li> <p style="font-size: 150%;font-family: 'arial';color: #000; ">The trip of a lifetime since it is more fun to travel with other people.</p> </li> <li> <p style="font-size: 150%;font-family: 'arial';color: #000; ">Cost savings since the room and other expenses (eg. taxi, food, etc.) can be shared with a travel buddy.</p> </li> <li> <p style="font-size: 150%;font-family: 'arial';color: #000; ">An increased feeling of safety knowing they won’t be by themselves.</p> </li> <li> <p style="font-size: 150%;font-family: 'arial';color: #000; ">Less stress since we do most of the planning.</p> </li> <li> <p style="font-size: 150%;font-family: 'arial';color: #000; ">Free time to explore in the various destinations.</p> </li> </ul> <p><span style="font-size: 150%; line-height: 40px; text-align: justify;font-family: 'arial';color: #000; "><br /> Want to learn more? Please visit our “How It Works” page or <a href="https://www.travelbuddytrips.com/contact-us" title="Contact Us" target="_blank">contact us today</a> and let the adventure begin!</span></p>
You’ll need to similarly edit all of your pages to delete the extra codes there.
- The topic ‘Removing title from pages on child theme’ is closed to new replies.