Jump to content

Archived

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

vinofanten

Creating custom single post templates for specific posts in DMS

Recommended Posts

vinofanten

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 (c) 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

Share this post


Link to post
Share on other sites
vinofanten

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?

Share this post


Link to post
Share on other sites
Rob

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.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
James Giroux

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.


James Giroux, CEO
Groundwork

Share this post


Link to post
Share on other sites
golok

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.

Share this post


Link to post
Share on other sites
James Giroux

Hey There,

 

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

 

James.


James Giroux, CEO
Groundwork

Share this post


Link to post
Share on other sites
James B

golok Hi there, please see - http://forum.pagelines.com/topic/23206-views-and-types-custom-types-fields-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/


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
DanatTLFN

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!

Share this post


Link to post
Share on other sites
michaeldallas

Interestingly, when I use the Headway Themes theme, it provides a drop down combo box in the Post WP UI that allows templates to be selected exactly like in the Pages WP UI. Is there an easy point and click way to assign a DMS template to a Post or set of Posts?

Share this post


Link to post
Share on other sites

  • Similar Content

    • Steve Webb
      By Steve Webb+
      I am having an issue with DMS editor not loading.  Just keeps spinning and spinning.
      Have tried several things - Logged in and out, cleared cache, deactivated all plugins, but the issue persists.
      I even had our host restore from a backup a few weeks ago, when I know it WAS working, as I edited a text box on the homepage.  The restore from backup didn't help either.
      Also, the front end of the site shows that the site is framed, or boxed now (whatever you call it), instead of full width as it was previously (last week).
      Dev console shows that there are php errors in Google maps - file is attached.
      Can someone please help?  Not sure what else I can do here...
      Thanks in advance.
      -Matt

    • tuciudadenred
      By tuciudadenred+
      Hi everyone, what happens is that the web page metrosalarmas.com has a google tags which I have not attacked where I can look to remove those tags and be able to locate the correct ones.
    • Steve Webb
      By Steve Webb+
      I am having an issue with DMS editor not loading.  Just keeps spinning and spinning.
      Have tried several things - Logged in and out, cleared cache, deactivated all plugins, but the issue persists.
      I even had our host restore from a backup a week ago, when I know it WAS working, as I edited a text box on the homepage.  The restore from backup didn't help either.
      Also, the front end of the site shows that the site is framed, or boxed now (whatever you call it), instead of full width as it was previously (last week).
      Dev console shows that there are php errors in Google maps - file is attached.
      Can someone please help?  Not sure what else I can do here...
      Thanks in advance.
      -Matt

    • JawDesigns
      By JawDesigns
      Hi everyone,
      Flywheel have reported errors on my clients site 'www.racewaredirect.co.uk' and it's not loading. Can someone please provide some information on how to fix this? The site has never experienced these issues before.
      Thanks,
      James Wilson
    • MissT
      By MissT+
      Hi there,
      I've got an issue with 3 websites built with DMS since I migrated them from http to https that I need help with please.
      When any changes are made - e.g. new posts added or existing posts amended - certain sections of the live site seem to break e.g. image headers hang and don't load (b/g on canvas section), sliders hang and don't load (Revslider), flipper section doesn't load.
      Logging in and then clicking 'Edit the site using DMS' seems to fix the problem. Often if I try to open up another browser window to edit the site / re publish I'm unable to as the page wont load / hangs while trying to load.
      Any ideas how to fix this? On a couple of the sites I've installed a caching plugin as I thought it might be a loading speed issue but it's still happening.
      Website URL's can be provided privately.
      Many thanks in advance.
×