Jump to content

Archived

This topic is now archived and is closed to further replies.

asialove

different post template for different category

Recommended Posts

asialove    6
asialove

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
Danny    1,327
Danny

Hi,

 

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

  • Like 1

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
asialove    6
asialove
 

 

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,,

 

 

Share this post


Link to post
Share on other sites
James B    436
James B

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. 


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites

×