Sign in to follow this  
Followers 0

different post template for different category

4 posts in this topic

Posted · Report post

Platform: Pageline DMS

Version: Free

 

First, please forgive my bad English :-(

 

 

Hi, all, is it possible to assign different template (includes different sections) to different post in different category?

 

I have post from two different category, one is apple, another one is orange, 

 

But i do not want the single post from apple category shows the content section. or a content section with smaller size.

 

The post in first category should have a postloop / content section, the post in second category should have widgets section only

 

Anyone has ever want this?

 

 

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

 

At the moment this isn't currently possible. However, I have already reported this to our tracker as a feature enhancement.

1 person likes this

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

 

 

I am using pageline dms free version,  i can not find a way to change templage based on cagetory ( i mean can not find a plugin to do that)

 

but finally i got solution

 

You need to find out the post types such as category, search, single, tags and assign section on each of that type of posts.

 

I have a category named "upcoming",  i want to hide/remove the content section on all post under the "upcoming" category

 

 

 

Here is some guides for those who are familier with PHP codes

 

First:  edit the editor.fileopts.php (/dms/editor/editor.fileopts.php)

if( isset( $this->data->export_types ) ) {
$lookup_array = array(
‘blog’,
‘category’,
‘search’,
‘tag’,
‘author’,
‘archive’,
‘page’,
‘post’,
’404_page’,
‘upcoming’ /*Change it to the type name you like
);

Second, 

 

Edit  the  "/dms/editor/editor.page.php"

 

locate   special_index_lookup ()

$lookup_array = array(
‘blog’,
‘category’,
‘search’,
‘upcoming’, /* this is what i add
‘tag’,
‘author’,
‘archive’,
‘page’,
‘post’,
’404_page’
);

Still in the "dms/editor/editor.page.php

 

locate the  the  “function type”

 

Add this:

elseif( is_category(‘upcoming’))
$type = ‘upcoming’;

 * change the upcoming to whatever you need.

 

Now back to the editor screen, save template, drop and drap sections,,

 

 

Edited by asialove

Share this post


Link to post
Share on other sites

Posted · Report post

Hi there, we don't advise editing the core files as any changes you make will be wiped when you update the theme. You'll need to use a hook/filter in the functions.php of a child theme to be able to keep the changes you make safe from being overwritten. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0