Community Forums › Forums › Archived Forums › Design Tips and Tricks › Centric Pro mystery page title
Tagged: centric pro, home page, page-title, post_title, widget
- This topic has 12 replies, 3 voices, and was last updated 8 years, 10 months ago by
detroitwidget.
-
AuthorPosts
-
April 17, 2016 at 7:26 pm #183796
jbculp
ParticipantI'm working on a site using Centric Pro. The site is under construction so if at all possible I can't turn off the underconstruction plugin (its complicated).
Anyway, in mucking around suddenly the HOME page title began showing up under the Home Featured Widget. There is a big padding which would be appropriate for a page title on a regular non-home page but here it's just a big gap then the word HOME. The title is clearly the page name of the Home page and is an H1 and in its own Div.Structure of that section of the page looks like this:
<div class="site-container">
<header class="site-header shrink" itemtype="http://schema.org/WPHeader" itemscope="">
<div class="bumper"></div>
<div class="home-featured">
<div class="page-title">
<div class="wrap">
<h1 class="entry-title" itemprop="headline">Home</h1>
</div>
</div>I only expanded the page-title div as it has the h1 in question. I don't just want to do a display none on page titles because that would hurt elsewhere on the site.
Since the div isn't a sub of the home-featured div, I don't know what selector to use to grab it. (I stink at css selectors.)I installed the genesis page-title plugin and un-clicked show page title on the home page but it's being pulled into the front-page anyway. Any ideas how to select this element so I can do a display:none? I would rather not modify the php as down the road it may come back to haunt me.
Thoughts?
April 18, 2016 at 5:16 am #183815Victor Font
ModeratorI just examined the source code in Centric Pro's front-page.php and the code you posted above does not appear to come from that template. The code in the standard front page is:
<div class="home-featured"> <div class="wrap"> <div class="home-widgets-1 color-section widget-area"> <!-- Widget Content --> </div> </div> </div>
You are missing a significant portion of the markup. You might be using a custom home page, but it's impossible for us to help with without seeing the site to examine the source code. As an FYI, the standard home page does not display post or page content because the loop is deactivated with the following code:
//* Remove the default Genesis loop remove_action( 'genesis_loop', 'genesis_do_loop' );
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?April 18, 2016 at 10:04 am #183838jbculp
ParticipantVictor,
Thanks for your reply. The structure I pasted in was only a fragment from what Firebug showed me. I did check the code for the front-page.php, comparing my version with that of the newest release of Centric Pro. They are exactly the same.
I suspect that it's a plugin causing problems. I'll deactivate all plugins and see if the issue goes away, then work my way back.
I appreciate your reply, especially since I was unable to put in the URL.
Best Wishes
jc
April 18, 2016 at 11:16 am #183842jbculp
ParticipantVictor,
Its a funny thing. I disabled all plugins and the problem didn't go away. I replaced my theme files with the current version, again, problem didn't go away.
I changed pages designated in WordPress read panel as Home Page to another page (contact page). Problem went away. I made a slight edit change to Contact page, hit save and the word CONTACT appeared on the front page just under Widget #1, just like before, only this time it didn't say HOME, it said CONTACT.
It's clear that the code in the functions.php is what's doing it but since the front-page.php removes the loop I'm not sure why it's there.... unless this bit from the functions.php is not part of the WordPress loop:
//* Reposition Page Title add_action( 'genesis_before', 'centric_post_title' ); function centric_post_title() { if ( is_page() and !is_page_template() ) { remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); add_action( 'genesis_after_header', 'centric_open_post_title', 1 ); add_action( 'genesis_after_header', 'genesis_do_post_title', 2 ); add_action( 'genesis_after_header', 'centric_close_post_title', 3 ); } elseif ( is_category() ) { remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 ); add_action( 'genesis_after_header', 'centric_open_post_title', 1 ) ; add_action( 'genesis_after_header', 'genesis_do_taxonomy_title_description', 2 ); add_action( 'genesis_after_header', 'centric_close_post_title', 3 ); } elseif ( is_search() ) { remove_action( 'genesis_before_loop', 'genesis_do_search_title' ); add_action( 'genesis_after_header', 'centric_open_post_title', 1 ) ; add_action( 'genesis_after_header', 'genesis_do_search_title', 2 ); add_action( 'genesis_after_header', 'centric_close_post_title', 3 ); } } function centric_open_post_title() { echo '<div class="page-title"><div class="wrap">'; } function centric_close_post_title() { echo '</div></div>'; }
Is it possible to add a logic statement that says if front page, do not add post_title?? My php knowledge is worse than my css selector knowledge. I will add a URL if that will really help but this is a live site in the middle of an overhaul (again, long story).
john
ps. thanks for the help.
April 18, 2016 at 5:35 pm #183874jbculp
ParticipantFIXED
If I change the home page, page template from Default to Landing, the mystery DIV with the page title goes away.
April 18, 2016 at 7:59 pm #183876Victor Font
ModeratorThere isn't any way to assign a page template to the Centric Pro front page. All you do is add widgets to it and the front-page activates. If you have a regular page that you have assigned a template to, you are not using the Centric Pro home page.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?April 18, 2016 at 8:38 pm #183877jbculp
ParticipantPoint of clarity. On every wordpress page there is a page template option, in Centric Pro it's Default, Landing, Archive, Blog.
WordPress and Centric Pro won't allow you to leave Front Page undesignated in the Settings > Readings settings. When I make that setting --Select-- instead of a page, the front page widgets disappear entirely. So, I have it pointing to an unused page called HOME. It was this page that had it's "page template" set to default. When I changed it to Landing, the problem went away.
That's what I mean by template.
Also, my functions.php and front-page.php are exactly the same code as the downloaded version so there is no custom work in play.
In any event, changing the setting on the page to Landing, fixed it.
April 19, 2016 at 8:19 am #183926Victor Font
ModeratorThat is not the case at all. I have Centric Pro installed on my local dev server and the front page works as every Studio Press theme front-page works. If you have to use a standard page, then something is not setup correctly on your site.
Under the WordPress Admin Reading settings, make sure "Your latest posts" is selected. Do not select anything for Static Page. This removes access to the theme's front page and forces you to use a standard page,
Make sure you have the front-page widgets populated with content in the Appearance/Widgets menu. This is what activates the front-page template. If there isn't at least one widget populated, you will see the standard WordPress blog page.
And there's another thing, none of the theme templates you referred to: Default, Landing, Archive, Blog; none of these templates have widget areas. I don't know how you can possibly be seeing widgets on these pages when they don't support them.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?April 19, 2016 at 9:49 am #183939jbculp
ParticipantVictor,
appreciate your help but I think we are missing somehow on communication. I'll pm you.
April 20, 2016 at 12:00 pm #184006detroitwidget
MemberJohn,
You're not the first person to get tripped up by Genesis page templates. And you're not doing anything wrong -- What you describe is normal Centric Pro behavior.
I suggest you read the following article. It's long, but worth reading:
http://www.billerickson.net/dont-use-genesis-blog-template/
I hope this helps.
April 20, 2016 at 3:44 pm #184020jbculp
ParticipantWhat I guess I didn't make clear is that I really have no intention of using the blog, this is a corporate site with a static front page. I recognize that Victor says I'm doing something wrong if I have to designate a front page in WordPress but I found that without it, no widgets showed up at all. I'm installing Centric Pro on a test server to see if I can recreate. Never the less, it's solved and until I can get the test install done, I'll have to assume, based on comments here, that something goofy is going on with my site.
Thanks all for your help. That's why I like the Genesis community.
jc
April 20, 2016 at 5:36 pm #184026Victor Font
ModeratorSetting the reading to blog page is the direction for using the front-page on every Studio Press theme. As soon as you add a widget in Appearance/Widgets, the blog disappears and the front-page template takes over. It all has to do with the WordPress template hierarchy. Unless you are using a landing page, you never have to designate a static home page with Studio Press themes. That's how the Genesis Framework functions.
Take a look at the WordPress template hierarchy, especially the front-page explanation. https://developer.wordpress.org/themes/basics/template-hierarchy/
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?April 21, 2016 at 10:02 am #184005detroitwidget
MemberJohn,
You're not the first person to get tripped up by Genesis page templates. I suggest you read the following article. It's long, but well worth reading if you plan on doing any WordPress development using Genesis:
http://www.billerickson.net/dont-use-genesis-blog-template/
Also, the WordPress Template Hierarchy:
https://developer.wordpress.org/themes/basics/template-hierarchy/
For reference, the development site below uses Centric Pro and was configured as follows:
Settings / Reading / Front page displays: A static page (select below)
Front page: Home (new page, default template)
Posts page: News (new page, default template)Appearance / Widgets: All Home page widgets configured per the Centric Pro theme setup instructions.
A simple CSS rule removes the page title from the new Home page:
.home .page-title {
display: none;
}Note: If no widget areas are active in any of the front page specific widget areas, a blog-style front page will be displayed. If you wish to use a static page set under Settings > Reading for your front page, do not add widgets to the front page widget areas, since doing this will override the static page. (In the case above, that's the exact behavior we are counting on.)
I hope this helps.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.