Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #244099

    Hi,

    I created a new posttype called “offers”

    I added a new function to functions.php:

    add_filter('single_template', create_function(
    	'$the_template',
    	'foreach( (array) get_the_category() as $cat ) {
    		if (file_exists("/single-{$cat->slug}.php") )
    		return "/single-{$cat->slug}.php"; }
    	return $the_template;' )
    );

    I created a new file called single-offers.php
    This page is the same as single.php only changed the line:

    get_template_part( 'includes/loop', 'index' );
    to
    get_template_part( 'includes/loop', 'aanbieding' );

    I created a new file called loop-offer.php t
    and pasted the same code as in loop-index.php in there.
    All is working perfect except.

    I want to edit the list overview of posts seperate from the single view of a post.

    Please help me out here.

    thanks

    fabian

    #244493

    Hi f!

    Thank you for using the theme!

    If you want to create a new post type, please follow this one. This is much more extensive and you’ll be able to select the post type when using the Blog Posts or Masonry elements. Duplicate the includes > admin > register-portfolio.php file. Rename it to something else, for example register-life.php. Replace it with this code: http://pastebin.com/ZBpzgbSe

    Add this on functions.php:

    require_once( 'includes/admin/register-life.php' );				// register custom post types for life entries
    

    This will register the custom post type life. You can now select the Life Entries when you’re using the Blog Posts or Fullwidth Masonry elements. Replace “life” with “offers”.

    Best regards,
    Ismael

    #256854

    Hi Ismael,

    This was all very helpful and working, thank you.

    How can I create a page like the loop-index.php for the new taxonomy I want the overview to have a different design.

    thanks

    #257240

    Hey!

    You can copy the file and include it into the layout using get_template_part as needed (with your own named file).

    Best regards,
    Devin

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.