Site logo

Archived topic

How to make static home page also blog page ?

3 replies · Started by Melissa Canonge on June 12, 2015

Viewing posts 1–4 of 4

Hi Melissa,
Regarding the blog + homepage (assuming that you're talking about this: http://bensettle.com/blog/ ) you can recreate that with the Hooks Add-On and some patience. It is not very hard.

If you feel confident with Html and css it's just a matter of minutes.

If you place this on your "After Header" hook:


<?php if ( is_home() ):?>

<section style="background:white; color:#000000; padding:50px 0;">
<div class="grid-container">
<div class="grid-50" style="text-align:center;">
<h2>Double Your Sales With Email</h2>
<p>World Class Email Specialist is Giving Away Tips forDoubling Sales Right Now</p>
</div>

<div class="grid-50" style="text-align:center;">
<p>use the form below to open his daily email tips and a free digital copy of the prestigious $97/month "Email Players" newsletter...</p>
<button style="background:green;">Here is the button</buttom>
</div>
</div>
<div class="grid-container">
<div class ="grid-100">
<p style="text-align:center;">I agree that when I sign up above, I will be added to a marketing mailing list where I will receive DAILY email tips and promotional offers from Ben Settle.</p>
</div>
</div>
</section>
<section style="background:#000000; color:#ffffff; padding:100px 0; text-align:center;">
<div class="grid-container">
<div class="grid-100">
<h3 style="color:#ffffff;">"Your Daily Email Addiction"</h3>
</div>
</div>
</section>
<?php endif; ?>

That should do the trick, it will display only on the post page.
Obviously, you will have to tweak it to reflect your needs.

Look, it is actually working here: http://generatepress.webserviceprovideo.com/news/

* * * * *

Regarding the menu, you will need to manually add some CSS as there's no option for adding borders within GP's customizer. Try Adding this css:


.inside-navigation.grid-container.grid-parent {
    border-bottom: 2px solid #000;
    border-top: 2px solid #000;
}

If you have any problem just let us know :-)

Have a good day

Roberto is exactly right! Thanks, Roberto!

Basically, you want to place whatever code you put in that section, inside the PHP given above.

So something like:

<?php if ( is_home() ) : ?>
      Your section content
<?php endif; ?>

Another option would be to use the Page Header add-on, go to "Appearance > Blog Page Header" and add your section HTML/shortcodes in the Content section.

The border CSS above is perfect as well - hoping to have a borders add-on soon :)

Thank you both very much!

This archived topic is closed to new replies.