Hi Domanic ,
I Had check this post : http://www.designwall.com/question/post-page-style-same-like-category-style/
and find that there is an option to show up the catagory with its defined color in post ,
In Admin panel In widget option we have an option to Show the meta infomation of post and selected "show the catagory info " Its works fine .
Is there any option to get the color of its catagory .
Hi,
To resolve this issue, you can open the widgets file in the \wp-content\themes\dw-focus\inc\widgets
folder.
Find the following code:
<?php
if( isset( $instance['cat'] ) && $instance['cat'] ) {
$categories_list = get_the_category_list( __( ', ', 'dw_focus' ) );
if ( $categories_list && dw_focus_categorized_blog() ) :
?>
<span class="cat-links">
<?php printf( '%1$s', $categories_list ); ?>
</span>
<?php
endif;
}
?>
Then replace with the following code:
<span class="cat-links">
<?php $sep = '';
foreach((get_the_category()) as $cat) {
echo $sep . '<a href="' . get_category_link($cat->term_id) . '" class="cat-' . $cat->slug . '" title="View all posts in '. esc_attr($cat->name) . '">' . $cat->cat_name . '</a>';
$sep = ', ';
}
?>
Right now, you can use class cat-
to change the Categories color.
Eg: your categories: Blog / Business / Entertainment.
Your Class:
.cat-blog {...}
.cat-business {....}
cat-entertainment {...}
Hope this helps !
Yes Domanic works awesome thanks save my day,
Hi Domanic i am back with a small question ,
Is there any possibilities to shortout the category which is showing in frontend on widget display area , I have selected more than one category for some post in frontend it displayed all the category which is got selected . Is there a way to display only selected category using category id or something like that.
Unfortunately, our theme do not support to make as you want.
Please login or Register to submit your answer