Custom post template?
-
I’m trying to develop a simple (easy to use) template for users to list products on their site.
I’m almost there, but need a bit of help with the last bit.
I’m using this in the functions.php to add some default content. It allows me to add and style anything I want to new posts. The only problem is that it adds the content to EVERY post.
Hoping someone can show me how to add my default content only to a specific category eg. products.
add_filter( 'default_content', 'custom_editor_content' ); function custom_editor_content( $content ) { $content = ' <div class="content-col-main"> This is your main page content </div> <div class="content-col-side"> This is your sidebar content </div> '; return $content; }
I did try using custom post types before, but it’s important to me that the “products” behave like normal wp posts, so they are easily sorted and play nicely with widgets like recent posts etc etc.
Hope someone can help – Thanks
[No bumping, thank you.]
- The topic ‘Custom post template?’ is closed to new replies.