Jared
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Popular Posts] CPT Category DisplayHi Hector,
That worked, thank you so much for your help!
Cheers!
Forum: Plugins
In reply to: [WP Popular Posts] CPT Category DisplayHi Hector,
We are not using a plugin. Below is the code used to create the CPT and category:
function register_cpts() { /** * Post Type: Product Pages */ $labels = array( "name" => __( "Products", "custom-post-type-ui" ), "singular_name" => __( "Product Page", "custom-post-type-ui" ), "menu_name" => __( "Products", "custom-post-type-ui" ), "all_items" => __( "All Product Pages", "custom-post-type-ui" ), "add_new_item" => __( "Add New Product Page", "custom-post-type-ui" ), "edit_item" => __( "Edit Product Page", "custom-post-type-ui" ), "new_item" => __( "New Product Page", "custom-post-type-ui" ), "view_item" => __( "View Product Page", "custom-post-type-ui" ), "view_items" => __( "View Product Pages", "custom-post-type-ui" ), "search_items" => __( "Search Product Pages", "custom-post-type-ui" ), "not_found" => __( "No product pages found", "custom-post-type-ui" ), "not_found_in_trash" => __( "No product pages found in Bin", "custom-post-type-ui" ), "parent_item_colon" => __( "Parent Product Page", "custom-post-type-ui" ), "featured_image" => __( "Featured image for this product page", "custom-post-type-ui" ), "set_featured_image" => __( "Set featured image for this product page", "custom-post-type-ui" ), "remove_featured_image" => __( "Remove featured image for this product page", "custom-post-type-ui" ), "use_featured_image" => __( "Use featured image for this product page", "custom-post-type-ui" ), "parent_item_colon" => __( "Parent Product Page", "custom-post-type-ui" ), ); $args = array( "label" => __( "Products", "custom-post-type-ui" ), "labels" => $labels, "description" => "Internal Product Pages", "public" => true, "publicly_queryable" => true, "show_ui" => true, "delete_with_user" => false, "show_in_rest" => true, "rest_base" => "", "rest_controller_class" => "WP_REST_Posts_Controller", "has_archive" => false, "show_in_menu" => true, "show_in_nav_menus" => true, "exclude_from_search" => false, "capability_type" => "post", "map_meta_cap" => true, "hierarchical" => false, "rewrite" => array( "slug" => "products", "with_front" => true ), "query_var" => true, "menu_position" => '', "menu_icon" => "dashicons-store", "supports" => array( "title", "editor", "revisions", "author" ), ); register_post_type( "products", $args ); } add_action( 'init', 'register_cpts' );function register_taxes() { /** * Taxonomy: Product Categories */ $labels = array( "name" => __( "Product Categories", "custom-post-type-ui" ), "singular_name" => __( "Product Category", "custom-post-type-ui" ), "menu_name" => __( "Categories", "custom-post-type-ui" ), "all_items" => __( "All Categories", "custom-post-type-ui" ), "edit_item" => __( "Edit Category", "custom-post-type-ui" ), "view_item" => __( "View Category", "custom-post-type-ui" ), "update_item" => __( "Update Category", "custom-post-type-ui" ), "add_new_item" => __( "Add New Category", "custom-post-type-ui" ), "new_item_name" => __( "New Category Name", "custom-post-type-ui" ), "parent_item" => __( "Parent Category", "custom-post-type-ui" ), "parent_item_colon" => __( "Parent Category:", "custom-post-type-ui" ), "search_items" => __( "Search Categories", "custom-post-type-ui" ), "separate_items_with_commas" => __( "Separate Categories with commas", "custom-post-type-ui" ), "add_or_remove_items" => __( "Add or remove categories", "custom-post-type-ui" ), "not_found" => __( "No categories found", "custom-post-type-ui" ), "no_terms" => __( "No categories", "custom-post-type-ui" ), ); $args = array( "label" => __( "Product Categories", "custom-post-type-ui" ), "labels" => $labels, "public" => true, "publicly_queryable" => true, "hierarchical" => true, "show_ui" => true, "show_in_menu" => true, "show_in_nav_menus" => true, "query_var" => true, "rewrite" => array( 'slug' => 'product-categories', 'with_front' => true, ), "show_admin_column" => true, "show_in_rest" => true, "rest_base" => "product-categories", "rest_controller_class" => "WP_REST_Terms_Controller", "show_in_quick_edit" => true, ); register_taxonomy( "product-categories", array( "products" ), $args ); } add_action( 'init', 'register_taxes' );Forum: Plugins
In reply to: [WP Popular Posts] CPT Category DisplayHi Hector,
We have set up a custom post type called ‘products’ as well as a custom post category called ‘product_categories’.
When using
post_type='products' stats_category="1"in the shortcode as well aspost_html='<li> <a href="{url}">{text_title} - {category}</a></li>'it does not display the product category.If we use that same shortcode attributes in ‘posts’ to display the default post title and category, ‘category’, it works fine.
How can we display the ‘product’ title as well as the assigned category from ‘product_categories’?
Also please note that we are not using WooCommerce, this is not a store product but a custom post type called products.
Thanks!
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] User Role EditorYes, once I disable User Role Editor, editors are able to access the tables to edit.
Disabling all other plugins and switching to Twenty Sixteen has the same result. When User Role Editor is active it redirects, when deactivated it works.
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] User Role EditorAll of those have been activated for all users.
It is very strange. I have even given all rights and allowed all menu items for the editor role and yet it still does the same thing.
When clicking on edit, or the name of the table, the URL does show in the address bar for a moment before redirecting to the homepage.
- This reply was modified 6 years, 11 months ago by Jared.