I’ve inserted a DW Focus: features News in a Dw Focus: Tabs into Home content widget area.
I want to add a simple link to all post category in the bottom-right corner. (e.g. “Read all [Name category] posts”)
How can I insert this link?
1 Answers
Hi MG!
To add a link please follow my instruction here:
1. Go to Dashboard / Appearance / Customize / General Settings , and add this code below to custom wp_head:
<style>
.dw-read-all {
display: none;
text-align: right;
padding-top: 10px;
clear: both;
text-transform: capitalize;
background: #fff;
z-index: 9999;
position: relative;
}
.dw_focus_featured_posts .dw-read-all {
display: block;
}
.home #primary .widget .tab-content:before, .home #primary .widget .tab-content:after {
top: 0;
}
</style>
2. Open file dw-focus-recent-posts.php in your site / wp-content / themes / your theme / inc / widgets/ dw-focus-recent-posts.php.
3. Add following code to line 156:
<?php if ($instance['category'] != 0) : ?>
<a class="dw-read-all" href="<?php echo get_category_link($instance['category']) ?>">Read all <?php echo get_cat_name($instance['category']); ?> posts</a>
<?php endif; ?>
Hi Wilfred!
Thanks so much, It works perfectly!
Please login or Register to submit your answer