Jump to content

Archived

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

ddyer

custom post types

Recommended Posts

ddyer    0
ddyer

What is the best way to display custom post types in DMS ? 

im using the Types pugin.

 

thanks 

ddyer

Share this post


Link to post
Share on other sites
Jake    74
Jake

Hi ddyer - I'm not familiar with that plugin but would think it has shortcode capability you could use in a text box?


Have you searched the forums yet or checked out the DMS user docs?

PageLines geek, blogging at MyUntangledLife.com

Share this post


Link to post
Share on other sites
jamieg270+    13
jamieg270

Hi ddyer,

 

I hit the same problem recently, and though I haven't come across a solution yet for me, one of the other solutions I've found so far might be suitable for you.

 

Types doesn't have a shortcode that you could use. However if you've set up your Custom Post Types correctly in Types, DMS will display them using its own archive page ( the same used for Posts). So if your Custom Post Type slug was 'case-studies' and it was set up correctly you would find all your custom posts at www.yourdomain.com/case-studies or www.yourdomain.com/blog/case-studies depending upon how you set up the CPT in Types. The problem with this is they display in exactly the same way as your blogroll does. Completely identical!! If you have Custom Fields associated with your Custom Post Type, they will not display either.

 

Types depends on you adjusting the postloop template file to add in the custom fields and to adjust the markup so you can have it display as you would want. However DMS and Framework do not have a postloop template the same way the 2013 theme does for example, so there is no way to directly template the Custom Post output except by using filters with hooks in the Functions file of your child theme. However at the moment I've not found out how to do that (I'm a complete novice when it comes to php, I know the basics, I can write a basic filter or action but this is beyond me at the moment!!)

 

In Pagelines Framework I used 'Post in Page' plugin (which can be found here:http://wordpress.org/plugins/posts-in-page/) , which gives you the ability to display a post or posts, a category or a custom post type/s or an individual post (by ID) within another Post or Page using a shortcode or a snippet of php in your template files. There is also a handy Template you can copy into your Child Theme folder and adjust to create custom layouts for your Custom Post Types or for a featured post etc. Its a very handy Plugin. That's great but it creates a reliance on another plugin I'm keen to avoid. Also I've not tested Post in Page with DMS yet.

 

The other option is to purchase Types complimentary Plugin 'Views' which works seamlessly with Types to allow you to display CPTs anywhere in your site and I believe (I've not looked at it closely) to adjust the markup that wraps around your CPTs, so you can create the layout you want. I've read forum posts where others have been using Views with DMS successfully.

 

DMS's built in support of properly declared Custom Post Types might be enough for your purposes, or maybe Post in Page or Views will work for you.

 

If anyone has any suggestions on how to adjust the Archive layout for Custom Posts and to add in Custom Fields using Filters and Hooks, I too would really appreciate it!! Otherwise I may be purchasing a Views licence...

  • Like 2

Share this post


Link to post
Share on other sites
ddyer    0
ddyer

jamieg270"] Thanks for your indepth feedback  and great insight. Have you read DMS post types article by Nick @[member="beardedavenger  http://betterdms.com/2013/09/11/dms-post-types/? He shows to use post types with DMS. 

 

Could a hook with Hooker plugin? Any plans for the Core developers of PL to create a versatile section or plugin? 

Pockets does custom post types but seems limited of how it is displayed on the front end.

Back to the drawing board lol

 

:geek:

Share this post


Link to post
Share on other sites
Rob    547
Rob

There are multiple plugins available, both free and premium, that can help you to create and display custom post types and fields.  I can't see any reason to create hooks for this, as that only makes a relatively simple process more complex.  You'd have to know which hook to use, as well as the code to apply to the hook.

 

See http://forum.pagelines.com/topic/29920-custom-post-types-in-postloop/?hl=post+type


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
jamieg270+    13
jamieg270

Rob, As you say getting Custom Post Types to display is easy, as per your link or using the Types (or equivalent) plugin, DMS is pretty excellent at getting Custom Post Types to display out of the box. The problem is getting Custom Fields associated with your Custom Post Type to display, and adjusting the underlying Markup to present those Custom Fields the way you want them.

 

Lets say you make a Custom Field titled 'Project' that you would like to display as the main heading, at the moment I can't find a way of doing that. My Custom Post Type simply displays as another Blog entry. With 2013 template  you could create a custom template that would display your custom post type the way you want to. You can replicate this using Post in Page plugin with DMS (I think). Which is cool, however I find the more Plugins I rely upon to achieve something the more 'at risk' my site is of one of those links in the chain breaking, so I was searching for a way to avoid extra plugins if at all possible.

 

In other threads on this topic the suggestion has been to create a filter on a hook to swap out the post heading, with my Custom Field. In principle I understand how that works (I've used a filter with a hook to replace some of the default text such as 'Leave a Reply' above the comment field), its just my skill with php hasn't met that level yet. I would argue that a line of two of code in your functions file is arguably more efficient and less risk than using a plugin to achieve the same.

 

Anyway this isn't a complaint or a criticism of DMS, it just does things in a different way and I think DMS really is the next best thing since sliced bread!! This is more an issue of my ignorance when it comes to php. However I'm getting up to speed pretty quickly, I can do the very basic stuff so its only a matter of time and perseverance before I get there.

 

ddyer, thanks I had read that but forgotten about it. I will look into that more closely and see if I can test some stuff out. However what isn't clear from that post, (which Nick did mention was a broad overview), is how to create your custom loop, which is what I'm interested in.

 

Jake, no problem. I've been a member of these forums for a long time, and found solutions and suggestions for so, so much in the past, but never really participated. Its well past time I contributed what I can back to the Pagelines community.

 

 

I think for the moment until I find a more robust solution I'll try Post in Page with DMS and see how that works. I'll report back on progress and let you guys know how it goes.

  • Like 1

Share this post


Link to post
Share on other sites
Rob    547
Rob

@jamieg270  Shouldn't the look be the result of applying a custom class to the custom post type, then styling it as needed?

 

Theoretically, a custom class or ID would allow you to style any element (post types included).


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
jamieg270+    13
jamieg270

Rob  Yes, if all you want to do is restyle the existing markup. But what about the custom fields which aren't displaying in DMS's loop? I need those to appear in the markup to be able to style them, and I need them to appear in a specific place in the markup with specific tags. What about elements I do not want, like some of the other meta data which appears under the Title. Yes you could adjust the css to take it out, but ideally you'd want it not to appear in the first place so you don't have to write additional redundant CSS. 

 

What about other scenarios where you want to wrap the loop output in your own markup so you have the underlying markup to display it the way you need or want, and using the correct semantic markup for the way its being displayed. WIth a custom loop you can do that.

 

At the moment the only way I can do this that I've found to date (as I don't know how to write the filter or which hook to add it to) is using Views (a paid for plugin) or Posts in Page, which is free, but intermittently updated.

 

ddyer  I've tested Posts in Page and it works with DMS. I've also been able to get the Custom Fields to display in a custom loop using Posts in Page. I'll post details soon.

Share this post


Link to post
Share on other sites
ddyer    0
ddyer

jamieg270 ive been playing around with plugin The Custom Content Type Manager has good short codes and widgets options to display post types.

 

look forward to seeing what you can achieve with Posts in Pages im hoping that PL releases a section or plugin soon. 

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

HI,

 

Firstly, if you're going to be using Custom Fields, I recommend Advanced Custom Fields plugin - http://www.advancedcustomfields.com/

You can then either add them via shortcode or use hooks.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • 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.
    • jeomiland
      By jeomiland+
      Hi
      I found this topic
      which talks about a similar issue I am having, but a little different. Hope someone can help me out.
      Best way to see the problem is to view http://cassclayton.com/ on Safari (Mac) compared to Firefox or Chrome. You will see the banner just under the fixed menubar has a gap between the menubar and top of the banner. Looking at Inspector, I found:
      <div class="fixed-top-pusher" style="height: 62px;"></div>
      <script> jQuery('.fixed-top-pusher').height( jQuery('.pl-fixed-top').height() ) </script>
      and indeed it seems the jquery is not always working consistently. For instance, if you simply refresh the page in Safari, it will loose the gap and all looks fine, so is it a browser cache issue that is interacting with the jquery? I do have W3 Total Cache installed. There must be a way to tell the code to make sure jquery is up and running and available to do it's majic?
      And perhaps there is just a better way to do this banner? Originally I tried several DMS sections and used the banner image as background, etc... Kept running into problems with resizing and the left/right parts of the image were getting chopped off. It is important the whole image show, so currently I just use a NextBox section with this code:
      <img src="[pl_site_url]/wp-content/uploads/2015/12/CassClayton-blues-tribute-banner.jpg" width="100%" />
      and it looks the way it should. Is there a better way to place a banner graphic under a fixed navbar and make sure the whole banner graphic displays regardless of screensize?
       
    • oseehys
      By oseehys+
      Hello There,
      So i want to use platform 5 and DMS sections on a single page, i am using a child theme with pinspro as my main theme and i activated platform 5, the only problem am having so far is the fixed option, my navbars are not aligning to their default size, and it will be great if platform 5 header and footer section will function, has anyone used this option, how can i make the best use of platform 5 and DMS on a site
      Cheers
    • kwaoru
      By kwaoru
      Hi,
      I desperately need to deactivate the responsive function on mobile for reasons. It looks so messy with the responsive look on mobile and not navigating or informative at all as it is. 
      I searched for solutions online and tries some of those that I found but nothing worked out. Also I found a previous post on this forum says that this theme pagelines DMS is not meant to be build to deactivate the responsive function... 
      Also tried with widget such as WPtouch to edit the mobile look a little more informative but as I am using "single page" theme on pagelines, the frontpage(main page) never appears on those app.
      Seems like not compatible?
      If there is no way to deactivate responsive function or I'll have to recreate another page just dedicated for a mobile page? or change the theme completely and build a page from scratch?
      I have been searching for this for two days already...
      Could anyone wise and kind out there, please help me?
       
      Thanks,
×