Jump to content


Photo

Creating custom single post templates for specific posts in DMS

dms single post template single.php

  • Please log in to reply
7 replies to this topic

#1 vinofanten

vinofanten

    Newbie

  • Members

  • 8 posts
  • Country: Country Flag

Posted 11 October 2013 - 04:08 PM

Hi.

 

I am currently using Pagelines DMS 1.0.4 and the Academy child theme (created by James Giroux) for my blog about pasta and wine. I would like to have separate single post templates when I'm posting pasta recipes and wine tasting notes, but I don't know how to create new templates for single posts in DMS. I have read a lot about how I must duplicate the single.php file in the theme folder and then rename the new file to something like single-post-recipe.php, but I don't know how I would assign the new file to specific single posts. I have downloaded the Custom Single Post Template plugin. Could this be used for this?

 

The Academy child theme refers to the DMS theme for editing the single.php file, but all I see in this file within the DMS template, is the following code. Should I just duplicate this file in the theme folder and rename it. And if so, how can I assign the new single post template to specific posts?

 

 

<?php
/**
 * PAGE
 *
 * This file meets the WordPress template requirements for 'single.php'
 *
 * @package     PageLines Framework
 * @since       1.0
 *
 * @link        http://www.pagelines.com/
 * @link        http://www.pagelines.com/DMS
 *
 * @author      PageLines   http://www.pagelines.com/
 * @copyright   Copyright © 2008-2012, PageLines  hello@pagelines.com
 *
 * @internal    last revised August 1, 2011
 * @version     ...
 *
 * @todo Define version
 */
 
setup_pagelines_template();
 
 
PS.
I would also like some tips on how to display custom field values (created with the Advanced Custom Fields plugin) using APIs and PHP in the new single.php file. What coding do I using for displaying the values below the title and featured image, but before the content text?
 
Hope for some helpful answers, as I am new to tweaking single post templates. :)
 
Kenneth


#2 vinofanten

vinofanten

    Newbie

  • Members

  • 8 posts
  • Country: Country Flag

Posted 11 October 2013 - 07:29 PM

Hi again. 

 

I have been playng with the issue above, and have figures out how to create a custom single post template, but I have yet to figure out which file the following code refers to:

 

setup_pagelines_template();

 

Where is this file?



#3 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 11 October 2013 - 09:16 PM

I don't believe that's a file, but a process.

 

SInce you're using the Academy theme, I'm moving this topic so that James may assist you directly with the creation of a post template.



#4 James Giroux

James Giroux

    Community Director

  • Moderators

  • 141 posts
  • LocationOttawa, Canada
  • Framework Version:Developer
  • Country: Country Flag

Posted 14 October 2013 - 03:07 PM

Hey Kenneth,

 

When it comes to templates for DMS, any custom post type you create has its own unique template created within DMS.  Unlike pages which each have a unique template, the custom post type has a general one for all posts within that post type.  As far as displaying the values of custom fields, the way that I typically do it is with the views plugin.  I don't typically jump into hooks and actions if a plugin can do it for me.  That being said, I think your best bet is to look at the functions.php file and leverage that as a type of single.php.  PageLines has a plugin called Hooker and another one called Action Map that allow to see where specific actions and hooks are located throughout the page.  That in my mind would be the best way to add in custom fields without using something like views to do it for you.  Views is a premium plugin but its power for your development needs is pretty awesome (http://wp-types.com/home/views-create-elegant-displays-for-your-content/).  If you're happy to add things in on your own then the action map and hooker plugins would be the best way to go.  

 

It's not really a theme issue but more about best practices or practices in general with PageLines DMS.  I'm surprised they sent you to me but here we are!  I hope that helps and if it doesn't, let me know and I'll see if I can track down a better solution for you.



#5 golok

golok

    Member

  • Members
  • 11 posts
  • LocationGeneva
  • Framework Version:2.4
  • Country: Country Flag

Posted 28 December 2013 - 03:51 AM

Hello,

I am currently using Pagelines Framework 2.4 and the Base Theme 1.0.2. Like vinofanten above, I would like to customize the single post template in order to display fields from the Advanced Custom Fields plugin.

Despite reading James Giroux comment, I'm not sure how to proceed… Could anyone enlighten me on this?

In advance thank you.


  • ketri likes this

#6 James Giroux

James Giroux

    Community Director

  • Moderators

  • 141 posts
  • LocationOttawa, Canada
  • Framework Version:Developer
  • Country: Country Flag

Posted 20 January 2014 - 04:17 PM

Hey There,

 

This theme is designed for PageLines DMS, not Framework.  Unfortunately none of the comments will apply to your situation.

 

James.



#7 James B

James B

    Advocate

  • Members

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

Posted 21 January 2014 - 01:24 AM

@golok Hi there, please see - http://forum.pagelin...-compatibility/ this is similar.  I'm not sure about the advanced custom fields plugin, but the Types plugin actually included shortcodes to show the fields, so you can actually do something like this in a Framework contentbox in the layout

 

Resource id: [types field="resource_id"]

 

http://wordpress.org/plugins/types/



#8 DanatTLFN

DanatTLFN

    Member

  • Members

  • 22 posts
  • Framework Version:2.4.4
  • Country: Country Flag

Posted 12 April 2014 - 02:18 PM

I have blog that showcases both Premium posts and Basic blogposts. Is it possible to set a template for a premium blogpost that is different from the basic blogposts?

 

Loving the pagelines service!







Also tagged with one or more of these keywords: dms, single post template, single.php