Different post template for one category

Posted in: Newspaper
Post count: 11

I would like to ask for some guidance (I appreciate any) how to set different post template and sidebar for only one category, categories to have generic sidebars for posts and categories (which I’ve already have).
Is it possible to achieve?

Post count: 7909

Hi,

Unfortunately theme doesn’t have an option to set the post template from a specific category, this can be done only manually for each article from that category. We have a similar suggestion on our list to set a general post template from category settings and the developers will consider this. I cannot promise you anything they will decide if this can be implemented in a future update. I’m not sure what you mean about the sidebars, if you set a custom sidebar for a category, all the posts from that category inherit the sidebar.

Thanks!

Post count: 2

Hi,

A workaround was provided 4 months ago in the Theme Forest comments (http://themeforest.net/item/newspaper/5489609/comments?page=217&filter=all#comment_9827881) regarding setting a specific post template for a certain category. Can you provide an updated version of this solution, please?

Post count: 7909

Hi,

It is different in this version bu t I have found a workaround http://screencast.com/t/gScAWE5u3tphttp://screencast.com/t/Z5dVpBXdgA Please make sure that you add the code properly and just change the category name and post template:

$current_categories = get_the_category($post->ID);
foreach ($current_categories as $category){
if ($category->cat_name == 'Vogue'){
$td_default_site_post_template = 'single_template_6';
}
}

$current_categories = get_the_category($post->ID);
foreach ($current_categories as $category){
if ($category->cat_name == 'Vogue'){
$td_post_theme_settings['td_post_template'] = 'single_template_6';
}
}

Thanks!

Post count: 2

Thank you, it worked perfectly.

Post count: 33

Hi, I’m having the same problem and need to use the same code, I’ve added the code but there is no change in the post or category windows to effect the changes, need help.
Thanks.

Post count: 22421

Hi,
@The Transnational Post
I tested this solution again and it still works, you just have to be careful where you place your code and change the category name to your own.
Please check the screenshots again and add the code exactly like in screenshots without deleting anything.
Thank you!

Post count: 33

Hi, I want to start working on the code,
$current_categories = get_the_category($post->ID);
foreach ($current_categories as $category){
if ($category->cat_name == ‘Vogue’){
$td_default_site_post_template = ‘single_template_6’;
}
}

$current_categories = get_the_category($post->ID);
foreach ($current_categories as $category){
if ($category->cat_name == ‘Vogue’){
$td_post_theme_settings[‘td_post_template’] = ‘single_template_6’;
}
}

Ok, the category here is Vogue, what is the name of the post template used. I am thinking ‘single_template_6’ right?, just want to know the name of the post template and can I use it for more than one category

Secondly, I uploaded AccessPress Social Counter plugin, how do I make the widget available on the Elements window so I can use it in the visual composer.

Thirdly, Is there any benefit of upgrading the visual composer to pro?

Thanks for all your help.

Post count: 22421

Hi,
Every post template has a specific class you can check here: http://screencast.com/t/GgiEwozGrpSQ
You can add multiple conditions to the code if you wish to change it.
As for the plugin, we are not sure how the plugin works. You will need to use the implementation method specified by the plugin author. If you want to modify this behavior, we cannot offer any suggestions as we have not tested the plugin and have no idea of it;s functionality.
For the third part, there is no benefit at all, as different versions of visual composer will not work with pur theme properly except for the one that comes bundled with our theme. Please use just the version you can install from here: http://screencast.com/t/iuv6drOf (we will update the plugin along with the theme)
Thank you!

Post count: 33

Hi,
Every post template has a specific class you can check here: http://screencast.com/t/GgiEwozGrpSQ
You can add multiple conditions to the code if you wish to change it.
As for the plugin, we are not sure how the plugin works. You will need to use the implementation method specified by the plugin author. If you want to modify this behavior, we cannot offer any suggestions as we have not tested the plugin and have no idea of it;s functionality.
For the third part, there is no benefit at all, as different versions of visual composer will not work with pur theme properly except for the one that comes bundled with our theme. Please use just the version you can install from here: http://screencast.com/t/iuv6drOf (we will update the plugin along with the theme)
Thank you!

Hello Bogdan,
I added the code to the php file as directed, but it is not saving the changes in the php file, I can see the changes in Adobe Edge code but not the theme folder, how do I make the changes appear in the newspaper theme folder?

Thanks.

Post count: 22421

Hi,
I’m not sure how your changes do not apply to the theme. Test this out with a simple trick. Delete all of the code from the file. Something should return an error. If the theme works fine withouth the whole code, it means you are not editing the correct file. Also keep in mind that if you use caching, the page could be loaded from the cache plugin and clear that as well. Everything you add or remove from the theme files will affect the front-end.
Thank you!

Post count: 268

Hi,

the system suggested works…

but if you wanted to change the style of posts of many categories,
or style of post of sub categories like follow

/category1/subcategoryA – /category1/subcategoryB – /category1/subcategoryC
ie change style of subcategoryA – subcategoryB – subcategoryC etc at the same time

how you should do?

Thanks!

Post count: 22421

Hi,
The method posted here will not work like that. If you want to customize it even further, you will have to hire a freeelancer to help out as custom work falls beyond what the theme support can offer you.
Thank you!

Viewing 13 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic.