- This topic has 9 replies, 4 voices, and was last updated 2 years, 2 months ago by David.
September 4, 2014 at 10:21 am #24315Kim Lindsey
We are loving Generate Press so far & have all the Add-Ons installed & activated.
Our site (beta URL is http://neostc.org/cmswp/) has a static Home page, and we are using the blog for the group’s newsletter.
On the blog page, we want to add a newsletter title BELOW the page header and (always) ABOVE the first post.
I don’t see a way to do this with GP Hooks.
Would this require a child theme? – If so, I’d appreciate some advice as it’s the first time I’ll be creating/using a child theme. In the generic WP support forums, I found this thread:
… but since it’s for a different theme, I didn’t want to try that method without asking.
Thanks for the great support we’ve had already with Generate Press! Great theme – makes everything so easy & flexible!September 4, 2014 at 11:38 am #24318TomLead DeveloperLead Developer
You could try doing something like this in the “Above Content” hook:
<?php if ( is_home() ) : ?> <header class="entry-header"> <h1 itemprop="headline" class="entry-title">Blog</h1> </header> <?php endif; ?>
is_homeis only true while on the blog.
Then, you’ll have to check the “Execute PHP” checkbox.
Let me know if that does it 🙂September 4, 2014 at 1:41 pm #24391Kim Lindsey
Thanks Tom! I see from the code that it should only affect the Blog page, which is exactly what we need.
I meet with my newsletter editors tomorrow night – how cool if this can be in place by then to show them!
I’ll try it this evening & let you know how it goes.
Thanks again!September 4, 2014 at 7:13 pm #24536Kim Lindsey
Well, the initial solution did not work. Instead of a page title at the top, it puts the text (“Blog” in your sample code) above the title of each individual blog Post.
So then I tried putting your code snippet into the “After Header” hook.
That actually did work!! – except that the text is aligned in the far left margin.
So now I just need to find a way to center it on the page – that would be the perfect position.
If this were a non-WP site, I could probably figure out how to do it, and I’m guessing it’s something to do with the .aligncenter class (is that the correct jargon?), but I don’t know where to insert it in your sample code for the hook.
** I know you’re probably busy with the WP 4.0 update. We hope to go live on 9/10, so if you can help in the next few days, it would be greatly appreciated. Thanks for your help!September 4, 2014 at 7:37 pm #24537TomLead DeveloperLead Developer
Ah – my mistake.
Okay, try this:
<?php if ( is_home() ) : ?> <div class="grid-container grid-parent"> <header class="entry-header"> <h1 itemprop="headline" class="entry-title">Blog</h1> </header> </div> <?php endif; ?>September 5, 2014 at 8:22 am #24743Kim Lindsey
That is perfect, except I’d really like it center-aligned.
How do I do that?
(P.S. – I even added an H2 sub-title and it worked great!)September 5, 2014 at 8:28 am #24744Kim Lindsey
Never mind – I think I got it! I added
div class=”grid-container grid-parent”
and now both my title & sub-title are center-aligned.
This is so sweet! Kudos to you Tom for a great theme!September 5, 2014 at 8:47 am #24746TomLead DeveloperLead Developer
Using align=”center” is kind of old when it comes to coding, so I suggest doing this to the opening div:
<div class="grid-container grid-parent" style="text-align:center;">November 9, 2018 at 12:08 pm #723248katia
i used your suggestion in order to show my blog title in the blog homepage, putting it “inside_container”, but this made title shown before Yoast breadcrumbs, while in every other pages of the site page title appears after breadcrumbs 🙁
Can you tell me how to fix this difference?
Thank you in advance!November 9, 2018 at 2:02 pm #723315
- You must be logged in to reply to this topic.