Jump to content
Sign in to follow this  
johnny_n

(Yet another) custom template question

Recommended Posts

johnny_n

I've used the templates/sections here http://www.pagelines.com/forum/discussion/12311/how-to-make-custom-page-templates to display a custom post type. Everything is working great after some experimentation. I don't need to create a custom loop, because these templates are for display purposes only (I need to display custom fields associated with that post type and remove the title). My question is, is there an easy way to remove the "default" display of a single post? I've added the custom display I need to the single template after this line: <?php pagelines_template_area('pagelines_main', 'main'); ?> But then I get the default display and then my custom display of the same post below it. When I remove that line, it takes away the single post navigation which I'd like to keep. What's the best way to either remove the custom display of the single post or to add back the navigation if I remove that line? I've tried css fixes of various IDs and classes and it didn't work: Thanks for any insight! [edit:] Actually, similar but related question. How do I remove the same navigation bar from the custom archives page -- it says "Viewing archives for..." which I don't need. That line above isn't in my archive template -- so there's clearly another way to add it -- but I can't work out how. ;-)

Share this post


Link to post
Share on other sites
Jenny
A link to your site would help a ton. :) What do you mean when you says "remove the "default" display of a single post"?

Jenny :: Web designer at Simple Mama (follow me at @simplemamacom)

Check out Share Me, a social sharing add-on for DMS that is super simple to set up.

Share this post


Link to post
Share on other sites
johnny_n
Yes, I'd prefer not to give a link -- the site is under development, etc. Here is a link to the single display -- see how the "default" display of the post is above and my display -- the way it should be -- is below? http://tinypic.com/r/4jmgpe/5 It looks to me like I'm going to have to create a custom loop since the display is tied to the loop itself in template.postloop.php. Correct? Btw, I did remove the navigation bar from the archives page with this css, so that part is out of the way: .archive.post-type-archive-POSTTYPE .current_posts_info{display:none!important;} Thanks in advance!

Share this post


Link to post
Share on other sites
Rob
If you don't want to send the link live via the forum that's fine, but please sent it to me or Simple_Mama using the Inbox option at the top of this page. Looking at a screenshot doesn't help us to diagnose the code on the post itself. Which template are you using?

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
johnny_n
Actually this ended up being an easy one to do but took me a while -- you don't necessarily need custom templates for it (if this is all you want to do), just modify template.postloop.php and add a conditional, than the display of the post as you want it. This nullifies the default display. The code regarding the content was necessary because it's outside the loop so the_content and get_the_content do not work... Like this... put the following code right after: // Start of 'The Loop' NEW BIT: // first, custom testimonials display if(get_post_type() == 'testimonials') { global $wpdb; $postdata = get_post($postid); ?>
post_content; ?>”

,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×