New Landing How can we help? Themeforest Theme Support Dante Custom post types & Dante

Viewing 2 posts - 1 through 2 (of 2 total)
  • Posted in: Dante
  • #282935
    enricotal70
    Member
    Post count: 8

    I’ve searched the forums various times and questions about issues with custom post types and Dante have been asked many times, but always about single issues and there are no guidelines, so I think it’d be useful to have a more comprehensive question/answer (I’ll try to link the already answered parts).

    At this point what is the best way to integrate a custom post type with Dante?

    The main issues faced are:
    -Add the swift editor button -> as far as I know it can be done but not in a child theme (answer here), so this is a problem. In this other answer it is said it can be done from child theme, but it’s older and I don’t understand how to implement it (I should look more into it).

    -Add the meta boxes -> here it is said it needs multiple edits. I managed to do it, but not from a child theme.

    -Create a custom template for the post type -> it can be done in the wordpress way, but it can’t be fullwidth, because by default the post is set to non-fullwidth (I still haven’t figured out how to set it to fullwidth).

    I’m sorry for the wide scope of the question, but custom post types are a quite common need and there doesn’t seem to be a comprehensive answer or a knowledgebase on how to make it work in Dante, and if there is a child-theme friendly way at all.

    Thank you!

    #283310
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    This is really going to depend on your skill level with PHP and experience with WP dev.

    Ideally, you would want to work with a dev if this is not something you are overly experienced with.

    1) Yes, this can be added to a child theme. I missed that filter initially. In your child theme functions.php you would use this:

    function pb_product_pages(  ) {
    	$pt_array = array('page', 'post', 'portfolio', 'product', 'team', 'jobs', 'ajde_events');
    	return $pt_array;
    }
    add_filter( 'spb_pt_array', 'pb_product_pages' );

    2) It would be complex to do this in a child theme. You could look to remove the filter add_filter( 'rwmb_meta_boxes', 'sf_register_meta_boxes' );, create your own new function in the child theme sf_register_meta_boxes_child() and then add that filter: add_filter( 'rwmb_meta_boxes', 'sf_register_meta_boxes_child' );.

    3) You can just duplicate page.php and then add your own template name at the top of the code:

    <?php
    	/*
    	Custom TemplateFull Width Page
    	*/
    ?>
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register