Jessica Paxton
asked 10 years ago

I set my frontpage in WordPress to latest posts.  How do I add a black content bar with the title “Today’s Headlines” above my latest posts on my homepage in DW Focus?

2 Answers
Wilfred
answered 10 years ago

Hi Jessica
1. To add a black content bar with the title “Today’s Headlines” above my latest posts on my homepage: 
– go to Dashboard / Appearance / Customize / General Settings , and add this code below to custom wp_head

 <style>
.section-title {
text-transform: uppercase;
font-family: "NovecentowideNormalRegular",Georgia,"Times New Roman",Times,serif;
font-size: 11px;
padding: 0 20px!important;
background: #000;
color: #FFF!important;
margin: 30px 0 0!important;
border: none!important;
-webkit-border-radius: 0!important;
-moz-border-radius: 0!important;
border-radius: 0!important;
-webkit-box-shadow: -1px 0 0 #222 inset;
-moz-box-shadow: -1px 0 0 #222 inset;
box-shadow: -1px 0 0 #222 inset;
}
</style>

– Open file index.php in your site / wp-content / themes / your theme / index.php – Replace following code – form line 15 to line 28 

 <?php if( is_active_sidebar( 'dw_focus_home' ) ) { ?>
<?php dynamic_sidebar('dw_focus_home'); ?>
<?php } else { ?>
<div class="content-inner">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'archive' ); ?>
<?php endwhile; ?>
</div>
<?php dw_focus_pagenavi(); ?>
<?php } ?>

with

 <?php dynamic_sidebar('dw_focus_home'); ?>
<h3 class="section-title">Today’s Headlines</h3>
<div class="content-inner">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'archive' ); ?>
<?php endwhile; ?>
</div>

 
2. How do I add a news slider above latest posts list on homepage? 
– Go to Dashboard / Appearance / widgets 
– Add “DW Focus: News Slider” widget to “Home Content” sidebar

Hope this helps!

Jessica Paxton
replied 10 years ago

Hi Wilfred – I was successful in adding the content bar on my homepage at http://www.ecoanchornyc.com but I just noticed the read more button at the bottom of the page no longer appears. How can I get it back?

Wilfred
answered 10 years ago

Hi Jessica,
To get “Read more” button back please add below code

<?php dw_focus_pagenavi(); ?>

to after this code:

<?php dynamic_sidebar('dw_focus_home'); ?>
<h3 class="section-title">Today’s Headlines</h3>
<div class="content-inner">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'archive' ); ?>
<?php endwhile; ?>
</div>

here is the final code that we have:

<?php dynamic_sidebar('dw_focus_home'); ?>
<h3 class="section-title">Today’s Headlines</h3>
<div class="content-inner">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'archive' ); ?>
<?php endwhile; ?>
</div>
<?php dw_focus_pagenavi(); ?>

Hope this helps !

Powered by DW Question & Answer Pro