Jump to content


Photo
- - - - -

different post template for different category


  • Please log in to reply
3 replies to this topic

#1 asialove

asialove

    Advanced Member

  • Members

  • 66 posts
  • Country: Country Flag

Posted 20 February 2014 - 01:03 PM

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?

 

 

 

 

 

 

 

 

 



#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 17636 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 20 February 2014 - 01:21 PM

Hi,

 

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


  • KimAnn03 likes this

#3 asialove

asialove

    Advanced Member

  • Members

  • 66 posts
  • Country: Country Flag

Posted 21 February 2014 - 01:14 AM

 

 

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, 21 February 2014 - 01:20 AM.


#4 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 21 February 2014 - 06:41 AM

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.