BuddyBoss Home – Web › Support Forums › Themes › BuddyBoss theme › Template for custom posts
Tagged: custom posts, templates
- This topic has 3 replies, 2 contibutors, and was last updated 9 years, 11 months ago by Alyssa.
Question
November 26, 2014 at 5:23 am #33679@milenaHi,
I am using a plugin for member’s projects. It uses custom posts, and needs to edit the single.php to display.
Here is what the author wrote to me:
You should add single-image.php, in order not to mess with your single.php template.
So, duplicate your single.php, rename it to single-image.php and then add the code I provided.
I did that- and put this file in both my child theme (he said put it in your active theme) and the main theme, since the child theme didn’t help. The custom posts are not reading it.
Is there something in the buddyboss theme that prevents adding new templates to posts/custom posts?
Answers
November 26, 2014 at 7:20 pm #33688@alyssa-buddyboss
AlyssaParticipant@milena I am not aware of anything in BuddyBoss that would prevent a custom post type.
November 27, 2014 at 6:37 am #33695@milenaAll the posts are asigned the single.php template. As I said I made another template and its not working automatically , although should.
November 27, 2014 at 7:43 pm #33706@alyssa-buddyboss
AlyssaParticipant@milena I think the issue stems from the way we request content. In our single.php file you will find code about line 17:
get_template_part( 'content', get_post_format() );
This is what grabs the content for the page.
So instead of copying single.php
copy content.php and rename it to content-image.php where “image” is the name of the new post type, if the post type is something else then you need to change it to that.
- The question ‘Template for custom posts’ is closed to new replies.