AZBros on "[Theme: Hueman] Add a Title Above List of Blog Posts on Front Page?"

ساخت وبلاگ

@Denzel - not trying to hijack your thread here; just giving @AZBros some options.

For the home page you can do it a couple of ways.

1. The quick-and-dirty way. Use the CSS :after pseudo-element to add it at the bottom of the flexslider container:

/* add heading line after flexslider */
#flexslider-featured:after { content: "Recent Articles"; display: inline-block; font-size: 32px; margin-left: 40%; padding-top: 20px;
}

Quick, and it works, but probably not the best option since it's tied to the flexslider and the centering is "iffy" in mobile views. But it doesn't require any theme file mods.

2. Modify index.php in your child theme.
a. Add your title at the top of the loop; that way it won't be displayed if there aren't any posts:

<?php if ( have_posts() ) : ?> <h2 class="my-title post-title">Recent Articles</h2>

I gave it a class of "post-title" so it would use the theme default styling. You could leave that off and give "my-title" your own styling instead.

b. Add this to your child theme css:

/* pull custom title up */
.featured.flexslider { margin-bottom: 10px;
}
/* align and spacing for custom title */
.my-title { text-align: center; margin-bottom: 20px;
}

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 170 تاريخ : سه شنبه 4 خرداد 1395 ساعت: 6:48