Home Forums Basel support forum Revolution Slider cant load portfolio/ projects custom post type might be a bug

Revolution Slider cant load portfolio/ projects custom post type might be a bug

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #19695

    andre.somepro
    Participant

    Hi,

    I tried creating a post-based slider using a selection of Post Ids mixing post, products, porfolio items via their post IDs.
    The porfolio items wont load by revolution slider. I have a licence and contactet the revolutino slider guys. They troubleshooted that issue and stated that its a theme based error.

    Strange is, that the slider detects and fetches the portfolio posts on a category based + recent-posts configuration of revolution slider. So the slider is able to fetch portfolio content at all, but not on certain configuration post based + selection of IDs.

    Im trying to get behind this error I just want to inform you about that issue.

    best regards

    Andre

    #19703

    Artem Temos
    Keymaster

    Hello,

    Our projects are a regular custom type created by WordPress code standards. If there are some additional requirements from Revolution Slider to make it compatible with their functionality so just let us know and we will implement them in our theme.

    Regards

    #19823

    andre.somepro
    Participant

    After troubleshooting (disable all plugins) generating a custom post type via CPT UI we im sure its a theme based problem. The strange thing is the revolution slider fetches portfolio items on recent post based slides. But he cant fetch portfolio posts via list of Ids.

    Please try it on your own installations. It takes a minute to set a demo slider using list of IDs and just force it to showcase a list of portfolio post Ids. It wont work

    Ive copied the post-types.php of theme to Themepunch of revolution slider they try to find out whats going on. best regards

    Andre

    #19830

    Artem Temos
    Keymaster

    Hi,

    Please, provide us a step by step description how we can reproduce the issue on our side. Also, ask Revolution Slider what is wrong from our side if they told that our theme post type is not compatible.

    Thank you in advance.

    #19849

    andre.somepro
    Participant

    Hi, thank you for rechecking o your side.

    Just take any slider with featured image as background and select post based by Ids. You will notice
    portfolio item wont be fetched up, all others items will.

    best regards

    Andre

    Attachments:
    You must be logged in to view attached files.
    #19856

    Artem Temos
    Keymaster

    Can you ask Revolution Slide what requirements do they have for custom post types to make it compatible with their slider? We use native WordPress function register_post_type to register it as well as all other themes and plugins.

    #19858

    andre.somepro
    Participant

    Im in contact with them and will keep you updated.

    #19860

    andre.somepro
    Participant

    Themepunch wrote back: Here is the general standard code which works great with slider.

    // Register Custom Post Type
    function custom_post_type() {
    
    	$labels = array(
    		'name'         => _x( 'Post Types', 'Post Type General Name', 'text_domain' ),
    		'singular_name'    => _x( 'Post Type', 'Post Type Singular Name', 'text_domain' ),
    		'menu_name'      => __( 'Post Types', 'text_domain' ),
    		'name_admin_bar'    => __( 'Post Type', 'text_domain' ),
    		'archives'       => __( 'Item Archives', 'text_domain' ),
    		'attributes'      => __( 'Item Attributes', 'text_domain' ),
    		'parent_item_colon'  => __( 'Parent Item:', 'text_domain' ),
    		'all_items'      => __( 'All Items', 'text_domain' ),
    		'add_new_item'     => __( 'Add New Item', 'text_domain' ),
    		'add_new'       => __( 'Add New', 'text_domain' ),
    		'new_item'       => __( 'New Item', 'text_domain' ),
    		'edit_item'      => __( 'Edit Item', 'text_domain' ),
    		'update_item'     => __( 'Update Item', 'text_domain' ),
    		'view_item'      => __( 'View Item', 'text_domain' ),
    		'view_items'      => __( 'View Items', 'text_domain' ),
    		'search_items'     => __( 'Search Item', 'text_domain' ),
    		'not_found'      => __( 'Not found', 'text_domain' ),
    		'not_found_in_trash'  => __( 'Not found in Trash', 'text_domain' ),
    		'featured_image'    => __( 'Featured Image', 'text_domain' ),
    		'set_featured_image'  => __( 'Set featured image', 'text_domain' ),
    		'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),
    		'use_featured_image'  => __( 'Use as featured image', 'text_domain' ),
    		'insert_into_item'   => __( 'Insert into item', 'text_domain' ),
    		'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),
    		'items_list'      => __( 'Items list', 'text_domain' ),
    		'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),
    		'filter_items_list'  => __( 'Filter items list', 'text_domain' ),
    	);
    	$args = array(
    		'label'        => __( 'Post Type', 'text_domain' ),
    		'description'     => __( 'Post Type Description', 'text_domain' ),
    		'labels'        => $labels,
    		'supports'       => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'custom-fields', 'page-attributes', 'post-formats', ),
    		'taxonomies'      => array( 'category', 'post_tag' ),
    		'hierarchical'     => false,
    		'public'        => true,
    		'show_ui'       => true,
    		'show_in_menu'     => true,
    		'menu_position'    => 5,
    		'show_in_admin_bar'  => true,
    		'show_in_nav_menus'  => true,
    		'can_export'      => true,
    		'has_archive'     => true,		
    		'exclude_from_search' => false,
    		'publicly_queryable'  => true,
    		'capability_type'   => 'page',
    	);
    	register_post_type( 'post_type', $args );
    
    }
    add_action( 'init', 'custom_post_type', 0 );
    #19863

    Artem Temos
    Keymaster

    We use an absolutely similar code in our theme. Here it is

    	
    add_action( 'init', array($this, 'register_portfolio'), 1 );
    
    public function register_portfolio() {
    
    		$labels = array(
    			'name'                => _x( 'Portfolio', 'Post Type General Name', $this->domain ),
    			'singular_name'       => _x( 'Project', 'Post Type Singular Name', $this->domain ),
    			'menu_name'           => __( 'Projects', $this->domain ),
    			'parent_item_colon'   => __( 'Parent Item:', $this->domain ),
    			'all_items'           => __( 'All Items', $this->domain ),
    			'view_item'           => __( 'View Item', $this->domain ),
    			'add_new_item'        => __( 'Add New Item', $this->domain ),
    			'add_new'             => __( 'Add New', $this->domain ),
    			'edit_item'           => __( 'Edit Item', $this->domain ),
    			'update_item'         => __( 'Update Item', $this->domain ),
    			'search_items'        => __( 'Search Item', $this->domain ),
    			'not_found'           => __( 'Not found', $this->domain ),
    			'not_found_in_trash'  => __( 'Not found in Trash', $this->domain ),
    		);
    
    		$args = array(
    			'label'               => __( 'portfolio', $this->domain ),
    			'labels'              => $labels,
    			'supports'            => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ),
    			'hierarchical'        => false,
    			'public'              => true,
    			'show_ui'             => true,
    			'show_in_menu'        => true,
    			'show_in_nav_menus'   => true,
    			'show_in_admin_bar'   => true,
    			'menu_position'       => 28,
    			'menu_icon'           => 'dashicons-images-alt2',
    			'can_export'          => true,
    			'has_archive'         => true,
    			'exclude_from_search' => true,
    			'publicly_queryable'  => true,
    			'rewrite'             => array('slug' => 'portfolio'),
    			'capability_type'     => 'page',
    		);
    
    		register_post_type( 'portfolio', $args );
    
    		/**
    		 * Create a taxonomy category for portfolio
    		 *
    		 * @uses  Inserts new taxonomy object into the list
    		 * @uses  Adds query vars
    		 *
    		 * @param string  Name of taxonomy object
    		 * @param array|string  Name of the object type for the taxonomy object.
    		 * @param array|string  Taxonomy arguments
    		 * @return null|WP_Error WP_Error if errors, otherwise null.
    		 */
    		
    		$labels = array(
    			'name'					=> _x( 'Project Categories', 'Taxonomy plural name', $this->domain ),
    			'singular_name'			=> _x( 'Project Category', 'Taxonomy singular name', $this->domain ),
    			'search_items'			=> __( 'Search Categories', $this->domain ),
    			'popular_items'			=> __( 'Popular Project Categories', $this->domain ),
    			'all_items'				=> __( 'All Project Categories', $this->domain ),
    			'parent_item'			=> __( 'Parent Category', $this->domain ),
    			'parent_item_colon'		=> __( 'Parent Category', $this->domain ),
    			'edit_item'				=> __( 'Edit Category', $this->domain ),
    			'update_item'			=> __( 'Update Category', $this->domain ),
    			'add_new_item'			=> __( 'Add New Category', $this->domain ),
    			'new_item_name'			=> __( 'New Category', $this->domain ),
    			'add_or_remove_items'	=> __( 'Add or remove Categories', $this->domain ),
    			'choose_from_most_used'	=> __( 'Choose from most used text-domain', $this->domain ),
    			'menu_name'				=> __( 'Category', $this->domain ),
    		);
    	
    		$args = array(
    			'labels'            => $labels,
    			'public'            => true,
    			'show_in_nav_menus' => true,
    			'show_admin_column' => false,
    			'hierarchical'      => true,
    			'show_tagcloud'     => true,
    			'show_ui'           => true,
    			'query_var'         => true,
    			'rewrite'           => true,
    			'query_var'         => true,
    			'capabilities'      => array(),
    		);
    	
    		register_taxonomy( 'project-cat', array( 'portfolio' ), $args );
    
    	}
    
    

    Regards

    #20203

    andre.somepro
    Participant

    For themepunch from revolution slider its a theme related issue. I will hire a programmer to solve the issue since I need this function.

    Another Example:
    If you install CPtomonies plugin it will warn you in its setting pages that portfolio is not a wordpress registered post type. It can detect it but it doesnt guarantee for the functionality with this post type.

    I will inform you as soon as I know whats the matter with this slider problem.

    best regards

    Andre

    #20207

    Artem Temos
    Keymaster

    OK, we will check with CPtomonies plugin too and try to solve the problem if it is caused by our theme.

    #20209

    andre.somepro
    Participant

    Hi forget about CPT-onomies plugin It detects the porfolio custom post type as correct since its update.

    I just checked because I wantet to sent you a screenshot in case.

    #20224

    Artem Temos
    Keymaster

    OK, contact us if you will have any additional information about the issue.

    #20958

    andre.somepro
    Participant

    The issue was in the definition of the ‘portfolio’ custom post type:

    the ‘exclude_from_search’ parameter was set to true – this was the cause of Revolution Slider not seeing this post type.

    I changed it to false and it should work.

    #20980

    Artem Temos
    Keymaster

    Thank you so much for posting your solution here. We will consider adding this fix to the core in our future updates.

    Kind Regards

Viewing 15 posts - 1 through 15 (of 15 total)