Tagged: custom post types
-
AuthorPosts
-
May 5, 2013 at 9:44 am #22848
Hi. I love the theme!
I want to use the blog layout but for custom posts in their own directory. I can’t get the html in the loop to load.
I have created a child theme and have done the following:
• I’ve copied the Index.php and labeled it cases.php
» Added a template label to cases.php
» Changed “get_template_part( ‘includes/loop’, ‘index’ );” to “get_template_part( ‘includes/loop’, cases’ );”
• Copied single.php and created a single-case.php
• Copied loop-index and created a loop-cases.php
» Added post query for cases to loop-cases.php
What am I missing something? If this it too much trouble, how much would I need to pay for an answer?
Thank you some much for your time!
Bethany
May 6, 2013 at 1:06 pm #117498Hi Bethany,
A page template in wordpress is what would be selected from the templates dropdown when creating a page. So adding the template label inside your cases.php would give you that file showing in that dropdown.
If you have not already, this is a good overview of templates http://codex.wordpress.org/Stepping_Into_Templates and http://codex.wordpress.org/Page_Templates
Generally, I’m not sure you’ll be able to do what you are looking for just because a custom post type isn’t a post but actually a page (a weird wordpress naming scheme). Blog posts specifically are the only thing in worpdress that gets treated like actual blog posts with the ability to use archives by date and things like that.
If its just the style of the page however, you may find this tutorial by Nick helpful: https://vimeo.com/channels/aviathemes/64996057
Regards,
Devin
May 13, 2013 at 2:05 am #117499Thank Devin for your help.
I have managed to get custom posts to feed into the blog and almost look like regular blog post but is missing some of the html. The custom posts have the small meta box picture to the left but the content is flowing over into the left margin because it is missing or because the css classes for the blog are not being applied. What can I do? Thank you so much. I seriously google a ton before asking question and I feel I understand more.
Bethany
May 13, 2013 at 5:14 am #117500Hey!
Please post a link – I need to investigate the html code to find the missing classes.
Regards,
Peter
May 13, 2013 at 4:10 pm #117501http://bethanywalter.com/advocateswest/cases/
Thank you Peter!
May 13, 2013 at 4:41 pm #117502Actually, go this this one instead.
May 13, 2013 at 9:59 pm #117503Never mind. I am have php issues on the other site.
May 14, 2013 at 12:45 am #117504Hi,
This seems to be working. Please add this on your custom.css
.cases .entry-content.clearfix.standard-content {
padding-left: 131px;
}Regards,
Ismael
May 15, 2013 at 3:30 am #117505Thanks for helping Ismael.
I am still confused. I took another close look at the page source differences between a regular blog post and a custom post and the I see all the same divs with exception of <div class=”status”> and some of the <div class=”post-10 cases type-cases status-publish hentry category-idaho tag-air tag-land tag-water tag-wildlife post-entry post-entry-type-standard post-entry-10 post-loop-1 post-parity-odd post-entry-last single-small with-slider”>, where cases would normally be posts. On the single custom post for cases, the sidebar even gets floated to the bottom of the page. I’m not sure why the css isn’t being applied.
May 15, 2013 at 3:33 am #117506Is it because the regular posts are getting targeted with an extra blog class because of location?
May 15, 2013 at 3:45 pm #117507Hi BWIdaho,
I’m not really sure what the issue is but if you apply the css above (from Ismael) the single page for the individual case looks correct with the sidebar and layout all positioned as it should be.
Regards,
Devin
May 16, 2013 at 5:48 pm #117508You are right. I don’t know what was different. Gah. Thank you for all your help!!
May 17, 2013 at 4:17 am #117509 -
AuthorPosts
- The topic ‘Duplicate blog page’ is closed to new replies.