Hello,
Our site has been using the collapsing categories for some years now.
However of late new products added to the collapsing categories are not added alphabetically.
View post on imgur.com
This is the interface I’m looking at to set the order:
View post on imgur.com
but the changes I make are not sorting the list alphabetically.
I have tried updating and reinstalling the plugin, but have not yet been able to get it to show elements in alphabetical order.
Your advice would be appreciated.
Hello,
I like this Plugin but it is not save because no update since 3 years.
Know anybody an alternative for this plugin?
Regards
]]>Good day,
The icons in the header of our site, and in the top menu, are not displaying correctly. I have done the following:
Checked in the back-end- it shows
Checked on my iphone- it shows
Checked on internet explorer- it shows
Cleared my cache
Went to Elementor> settings> Load Font Awesome 4 Support is ticked
Please help. Thanks so much!
]]>works fine on user side but it creates an extra category widget in admin area so when i go to edit or create a post there are 2 category blocks.
then i must make sure all my relevant categories are selected in BOTH blocks or WP will fail to update categories correctly.
plugin is unusable until this is fixed.
thanks for your efforts however. It is a very good plugin except for this problem.
I love this plugin thanks so much for making it.
Would you be able to update it so that it uses the newest/current font awesome version?
It is creating big problems when using this plugin with any other plugin that uses font awesome, which is lots.
??
]]>When I activate the plug in it causes a conflict which results in all other Jevelin theme icons to disappear. Any ideas on a fix? Thanks.
]]>Great and useful plugin! However when activated, the wp-admin posts panel has duplicate category widgets, and therefore the “Add New Category” link doesn’t work (duplicate ID’s I suspect). Also, very confusing for users.
When using the “Screen Options” pulldown and de-selecting the categories widget from there, only 1 widget is hidden while the other remains visible.
Thanks!
]]>Great and useful plugin! However when activated, the wp-admin posts panel has duplicate category widgets, and therefore the “Add New Category” link doesn’t work (duplicate ID’s I suspect). Also, very confusing for users.
When using the “Screen Options” pulldown and de-selecting the categories widget from there, only 1 widget is hidden while the other remains visible.
Screenshot attached. Thanks!
]]>Please take a look at my side bar i have followed the steps but not working as expected
]]>I love this plugin, it’s great.
Please can you add the option to collapse the categories on all pages except category pages and posts.
I have edited the code slightly to achieve this by adding
&& !is_page()
next to the !is_front_page()
to the collapscatlist.php
Anyone else who want to do this, here is all the code of collapscatlist.php
But not safe for any further updates.
<?php
/*
Plugin Name: Collapsing category list
Plugin URI: https://www.interadictos.es/category/proyectos-personales-profesionales/
Description: Filter for collapsing the categories list
Version: 0.5.4
Author: José Miguel Gil Córdoba
Author URI: https://josemiguel.nom.es
Text Domain: collapsing-category-list
Domain Path: /languages
License: GPLv2 or later
*/
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
define( 'PLUGIN_NAME', 'collapsing-category-list' );
include 'administration.php';
$theme_name = wp_get_theme();
$img_path = plugin_dir_url( __FILE__ ) .'images/';
if ($theme_name->get ( 'Name' ) == 'Twenty Fourteen' || $theme_name->get ( 'Name' ) == 'Twenty Thirteen') {
$img_collapse_global = $img_path . 'collapse_neg.gif';
$img_expand_global = $img_path . 'expand_neg.gif';
define( 'ALT_COLOR_GLOBAL', '-alt');
}
else {
$img_collapse_global = $img_path . 'collapse.gif';
$img_expand_global = $img_path . 'expand.gif';
define( 'ALT_COLOR_GLOBAL', '');
}
/**
* Class Walker_Category_Modify
* Modify class from Walker_Category
*/
class Walker_Category_Modify extends Walker_Category{
/**
* @see Walker::start_el()
* @since 2.1.0
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $category Category data object.
* @param int $depth Depth of category in reference to parents.
* @param array $args
*/
function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
global $post, $wp_version;
/** This filter is documented in wp-includes/category-template.php */
$cat_name = apply_filters(
'list_cats',
esc_attr( $category->name ),
$category
);
// Don't generate an element if the category name is empty.
if ( ! $cat_name ) {
return;
}
extract( $args );
// Variables for Collapsing Categories List
$remove_link_for_categories_array = explode(',', $remove_link_for_categories);
$hide_categories_array = explode(',', $hide_categories);
$not_collapse_array = explode(',', $not_collapse);
$current_categories = get_cat_ID($cat_name);
$image_children = '';
// Remove white space
foreach ( $remove_link_for_categories_array as &$elem) {
$elem = trim($elem);
}
foreach ( $hide_categories_array as &$elem) {
$elem = trim($elem);
}
foreach ( $not_collapse_array as &$elem) {
$elem = trim($elem);
}
// Check if the category has children
if (!$has_children && !empty($category->parent)) {
$has_children = 1;
}
// Back compatibility
if (is_array($current_categories)) {
if (empty($current_category) && $wp_version < 4.4) {
$current_category = $current_categories[0];
}
else {
$current_category = $current_categories[0]->term_id;
}
}
else {
if (empty($current_category)) {
$current_category = $current_categories;
}
}
// Get the category name
$cat_name = esc_attr( $category->name );
$cat_name = apply_filters( 'list_cats', $cat_name, $category );
// Make the link
$link = $this->make_link_hide_icon($category, $args, $cat_name, $not_collapse_array, $current_category, $remove_link_for_categories_array);
if ( !empty($feed_image) || !empty($feed) ) {
$link .= ' ';
if ( empty($feed_image) )
$link .= '(';
$link .= '<a href="' . esc_url( get_term_feed_link( $category->term_id, $category->taxonomy, $feed_type ) ) . '"';
if ( empty($feed) ) {
$alt = ' alt="' . sprintf( __( 'Feed for all posts filed under %s' ), $cat_name ) . '"';
} else {
$title = ' title="' . $feed . '"';
$alt = ' alt="' . $feed . '"';
$name = $feed;
$link .= $title;
}
$link .= '>';
if ( empty($feed_image) )
$link .= $name;
else
$link .= "<img src='$feed_image'$alt$title" . ' />';
$link .= '</a>';
if ( empty($feed_image) )
$link .= ')';
}
if ( !empty($show_count) )
$link .= ' (' . number_format_i18n( $category->count ) . ')';
if (!$hide_icons) {
if ( 1 != $args['has_children'] || !$collaps_categories || false !== array_search($cat_name, $not_collapse_array) ){
if (!empty($img_collapse) && (bool) !$use_class) {
$image_children = '<img src="'. plugin_dir_url( __FILE__ ) .'/images/nothing.gif" width="9px" height="9px" />';
}
else {
$image_children = '<i class="collapscatlist-nothing icon-nothing-squared"></i>';
}
}
else {
if ( !empty($current_category)) {
if (is_object($current_category)) {
$_current_category = $current_category;
}
elseif (is_single()) {
$cat_post = get_the_category($post->ID);
$_current_category = $cat_post[0];
}
else {
$_current_category = get_term( $current_category, $category->taxonomy );
}
$some_child_expanded = $this->check_children_expanded($category->term_id, $_current_category->term_id);
if ( ($category->term_id == $_current_category->term_id ||
$category->term_id == $_current_category->parent ||
$some_child_expanded) && !is_front_page() &&
!$collaps_categories_post && !is_page() ) {
$image_children = '<a href="#" class="collapse">';
if (!empty($img_collapse) && (bool) !$use_class) {
$image_children .= '<img src="'. $img_collapse .'" />';
}
else {
$image_children .= '<i class="icon-minus-squared' . ALT_COLOR_GLOBAL . '"></i>';
}
$image_children .= '</a>';
}
else {
$image_children = '<a href="#" class="expand">';
if (!empty($img_expand) && (bool) !$use_class) {
$image_children .= '<img src="'. $img_expand .'" />';
}
else {
$image_children .= '<i class="icon-plus-squared' . ALT_COLOR_GLOBAL . '"></i>';
}
$image_children .= '</a>';
}
}
else {
$image_children = '<a href="#" class="expand">';
if (!empty($img_expand) && (bool) !$use_class) {
$image_children .= '<img src="'. $img_expand .'" />';
}
else {
$image_children .= '<i class="icon-plus-squared' . ALT_COLOR_GLOBAL . '"></i>';
}
$image_children .= '</a>';
}
}
}
if ( 'list' == $args['style'] ) {
$output .= "\t<li";
$css_classes = array(
'cat-item',
'cat-item-' . $category->term_id,
);
if ( !empty($current_category) ) {
// 'current_category' can be an array, so we use <code>get_terms()</code>.
$_current_terms = get_terms( $category->taxonomy, array(
'include' => $args['current_category'],
'hide_empty' => false,
) );
foreach ( $_current_terms as $_current_term ) {
if ( $category->term_id == $_current_term->term_id ) {
$css_classes[] = 'current-cat';
} elseif ( $category->term_id == $_current_term->parent ) {
$css_classes[] = 'current-cat-parent';
}
}
}
if ( array_search($cat_name, $hide_categories_array) !== FALSE ) {
$css_classes[] = 'hide';
}
/**
* Filter the list of CSS classes to include with each category in the list.
*
* @since 4.2.0
*
* @see wp_list_categories()
*
* @param array $css_classes An array of CSS classes to be applied to each list item.
* @param object $category Category data object.
* @param int $depth Depth of page, used for padding.
* @param array $args An array of wp_list_categories() arguments.
*/
$css_classes = implode( ' ', apply_filters( 'category_css_class', $css_classes, $category, $depth, $args ) );
$output .= ' class="' . $css_classes . '"';
$output .= ">$image_children $link\n";
} elseif ( isset( $args['separator'] ) ) {
$output .= "\t$link" . $args['separator'] . "\n";
} else {
$output .= "\t$link<br />\n";
}
}
private function make_link_hide_icon($category, $args, $cat_name, $not_collapse_array, $current_category, $remove_link_for_categories_array) {
if (1 != $args['has_children'] || !$args['remove_parent_link'] || $args['hide_icons']) {
$link = $this->make_link($args, $cat_name, $not_collapse_array, $current_category, $category, $remove_link_for_categories_array, esc_url( get_term_link( $category ) ));
}
else {
$link = $cat_name;
}
return $link;
}
private function make_link ($args, $cat_name, $not_collapse_array, $current_category, $category, $remove_link_for_categories_array, $url) {
$link = '<a href="';
if (!$args['hide_icons'] && array_search($cat_name, $remove_link_for_categories_array) !== FALSE) {
$link .= '#"';
if ($args['hide_icons']) {
$link .= ' class="collapscatlist_hide_icon ';
}
}
else {
$link .= $url . '"';
if ($args['hide_icons']) {
$link .= ' class="collapscatlist_hide_icon ';
}
}
if ( 1 != $args['has_children'] || !$args['collaps_categories'] || false !== array_search($cat_name, $not_collapse_array) ){
$link .= '"';
}
else {
if ( !empty($current_category)) {
if (is_object($current_category)) {
$_current_category = $current_category;
}
else {
$_current_category = get_term( $current_category, $category->taxonomy );
}
if ( ($category->term_id == $_current_category->term_id ||
$category->term_id == $_current_category->parent) && !is_front_page() && !is_page()) {
$link .= ' collapse" ';
} else {
$link .= ' expand" ';
}
}
else {
$link .= ' expand" ';
}
}
if ( $args['use_desc_for_title'] && ! empty( $category->description ) ) {
/**
* Filter the category description for display.
*
* @since 1.2.0
*
* @param string $description Category description.
* @param object $category Category object.
*/
$link .= 'title="' . esc_attr( strip_tags( apply_filters( 'category_description', $category->description, $category ) ) ) . '"';
}
$link .= '>';
$link .= $cat_name . '</a>';
return $link;
}
private function check_children_expanded($id_category, $current_category) {
$terms = get_term_children($id_category, 'category');
$children_expanded = false;
if (count($terms) > 1) {
foreach ($terms as $term) {
if ($term == $current_category) {
$children_expanded = true;
break;
}
}
}
return $children_expanded;
}
}
/**
* Class WP_Widget_Collaps_Categories
* Modify class WP_Widget_Categories
*/
class WP_Widget_Collaps_Categories extends WP_Widget {
function __construct() {
$widget_ops = array( 'classname' => 'widget_categories', 'description' => __( "A list or dropdown of categories" ) );
parent::__construct('categories', __('Categories'), $widget_ops);
}
function widget( $args, $instance ) {
global $img_collapse_global, $img_expand_global;
extract( $args );
$title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'Categories' ) : $instance['title'], $instance, $this->id_base);
$c = ! empty( $instance['count'] ) ? '1' : '0';
$h = ! empty( $instance['hierarchical'] ) ? '1' : '0';
$d = ! empty( $instance['dropdown'] ) ? '1' : '0';
$cc = ! empty ( $instance['collaps_categories'] ) ? '1' : '0';
$remove_parent_link = ! empty ( $instance['remove_parent_link'] ) ? '1' : '0';
$img_collapse = ! empty ( $instance['img_collapse'] ) ? $instance['img_collapse'] : $img_collapse_global;
$img_expand = ! empty ( $instance['img_expand'] ) ? $instance['img_expand'] : $img_expand_global;
$use_class = (! empty( $instance['use_class'] ) ) ? '1' : '';
$remove_link_for_categories = ! empty ( $instance['remove_link_for_categories'] ) ? $instance['remove_link_for_categories'] : '';
$hide_categories = ! empty ( $instance['hide_categories'] ) ? $instance['hide_categories'] : '';
$not_collapse = ! empty ( $instance['not_collapse'] ) ? $instance['not_collapse'] : '';
$hide_icons = ! empty ( $instance['hide_icons'] ) ? '1' : '0';
$collaps_categories_post = ! empty( $instance['collaps_categories_post'] ) ? '1' : '0';
if (array_key_exists('order_by', $instance)) {
switch ($instance['order_by']) {
case 0:
$order_by = 'name';
break;
case 1:
$order_by = 'slug';
break;
default:
$order_by = 'name';
break;
}
}
else {
$order_by = 'name';
}
echo $before_widget;
if ( $title )
echo $before_title . $title . $after_title;
$cat_args = array(
'orderby' => $order_by,
'show_count' => $c,
'hierarchical' => $h,
'collaps_categories' => $cc,
'img_collapse' => $img_collapse,
'img_expand' => $img_expand,
'use_class' => $use_class,
'remove_parent_link' => $remove_parent_link,
'remove_link_for_categories' => $remove_link_for_categories,
'hide_categories' => $hide_categories,
'not_collapse' => $not_collapse,
'hide_icons' => $hide_icons,
'collaps_categories_post' => $collaps_categories_post,
);
if ( $d ) {
$cat_args['show_option_none'] = __('Select Category');
wp_dropdown_categories(apply_filters('widget_categories_dropdown_args', $cat_args));
?>
<script type='text/javascript'>
/* <![CDATA[ */
var dropdown = document.getElementById("cat");
function onCatChange() {
if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
location.href = "<?php echo home_url(); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
}
}
dropdown.onchange = onCatChange;
/* ]]> */
</script>
<?php
} else {
?>
<ul>
<?php
$cat_args['title_li'] = '';
wp_list_categories(apply_filters('widget_categories_args', $cat_args));
?>
</ul>
<?php
}
echo $after_widget;
}
function update( $new_instance, $old_instance ) {
global $img_collapse_global, $img_expand_global;
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['count'] = !empty($new_instance['count']) ? 1 : 0;
$instance['hierarchical'] = !empty($new_instance['hierarchical']) ? 1 : 0;
$instance['dropdown'] = !empty($new_instance['dropdown']) ? 1 : 0;
$instance['collaps_categories'] = !empty($new_instance['collaps_categories']) ? 1 : 0;
$instance['img_collapse'] = strip_tags(!empty($new_instance['img_collapse']) ? $new_instance['img_collapse'] : $img_collapse_global);
$instance['img_expand'] = strip_tags(!empty($new_instance['img_expand']) ? $new_instance['img_expand'] : $img_expand_global);
$instance['use_class'] = !empty( $new_instance['use_class'] ) ? 1 : 0;
$instance['remove_parent_link'] = !empty($new_instance['remove_parent_link']) ? 1 : 0;
$instance['remove_link_for_categories'] = strip_tags(!empty($new_instance['remove_link_for_categories'])) ? $new_instance['remove_link_for_categories'] : '';
$instance['hide_categories'] = strip_tags(!empty($new_instance['hide_categories'])) ? $new_instance['hide_categories'] : '';
$instance['order_by'] = !empty($new_instance['order_by']) ? $new_instance['order_by'] : 0;
$instance['not_collapse'] = !empty($new_instance['not_collapse']) ? $new_instance['not_collapse'] : '';
$instance['hide_icons'] = !empty($new_instance['hide_icons']) ? 1 : 0;
$instance['collaps_categories_post'] = !empty($new_instance['collaps_categories_post']) ? 1 : 0;
return $instance;
}
function form( $instance ) {
global $img_collapse_global, $img_expand_global;
//Defaults
$instance = wp_parse_args( (array) $instance, array( 'title' => '') );
$title = esc_attr( $instance['title'] );
$count = isset($instance['count']) ? (bool) $instance['count'] :false;
$hierarchical = isset( $instance['hierarchical'] ) ? (bool) $instance['hierarchical'] : false;
$dropdown = isset( $instance['dropdown'] ) ? (bool) $instance['dropdown'] : false;
$collaps_categories = isset( $instance['collaps_categories'] ) ? (bool) $instance['collaps_categories'] : false;
$img_collapse = isset( $instance['img_collapse'] ) ? $instance['img_collapse'] : $img_collapse_global;
$img_expand = isset( $instance['img_expand'] ) ? $instance['img_expand'] : $img_expand_global;
$use_class = isset( $instance['use_class'] ) ? (bool) $instance['use_class'] : false;
$remove_parent_link = isset( $instance['remove_parent_link'] ) ? (bool) $instance['remove_parent_link'] : false;
$remove_link_for_categories = isset( $instance['remove_link_for_categories'] ) ? $instance['remove_link_for_categories'] : '';
$hide_categories = isset( $instance['hide_categories'] ) ? $instance['hide_categories'] : '';
$order_by = isset( $instance['order_by'] ) ? $instance['order_by'] : 0;
$not_collapse = isset( $instance['not_collapse'] ) ? $instance['not_collapse'] : '';
$hide_icons = isset( $instance['hide_icons']) ? (bool) $instance['hide_icons'] : '';
$collaps_categories_post = isset( $instance['collaps_categories_post']) ? (bool) $instance['collaps_categories_post'] : '';
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
<p>
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>"<?php checked( $dropdown ); ?> />
<label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e( 'Display as dropdown' ); ?></label><br />
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>"<?php checked( $count ); ?> />
<label for="<?php echo $this->get_field_id('count'); ?>"><?php _e( 'Show post counts' ); ?></label><br />
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('hierarchical'); ?>" name="<?php echo $this->get_field_name('hierarchical'); ?>"<?php checked( $hierarchical ); ?> />
<label for="<?php echo $this->get_field_id('hierarchical'); ?>"><?php _e( 'Show hierarchy' ); ?></label><br />
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('collaps_categories'); ?>" name="<?php echo $this->get_field_name('collaps_categories'); ?>"<?php checked( $collaps_categories ); ?> />
<label for="<?php echo $this->get_field_id('collaps_categories'); ?>"><?php _e( 'Collaps categories', 'collapsing-category-list' ); ?></label><br />
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('remove_parent_link'); ?>" name="<?php echo $this->get_field_name('remove_parent_link'); ?>"<?php checked( $remove_parent_link ); ?> />
<label for="<?php echo $this->get_field_id('remove_parent_link'); ?>"><?php _e( 'Remove all links', 'collapsing-category-list' ); ?></label><br />
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('hide_icons'); ?>" name="<?php echo $this->get_field_name('hide_icons'); ?>"<?php checked( $hide_icons ); ?> />
<label for="<?php echo $this->get_field_id('hide_icons'); ?>"><?php _e( 'Hide icons to expand / collapse categories. (The link will be used to expand / collapse categories)', 'collapsing-category-list' ); ?></label><br />
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('collaps_categories_post'); ?>" name="<?php echo $this->get_field_name('collaps_categories_post'); ?>"<?php checked( $collaps_categories_post ); ?> />
<label for="<?php echo $this->get_field_id('collaps_categories_post'); ?>"><?php _e( 'Collapse categories when show a post', 'collapsing-category-list' ); ?></label><br />
</p>
<p>
<label for="<?php echo $this->get_field_id('order_by'); ?>"><?php _e( 'Order by:', 'collapsing-category-list' ); ?></label>
<select class="widefat" id="<?php echo $this->get_field_id('order_by'); ?>" name="<?php echo $this->get_field_name('order_by'); ?>">
<option value="0" <?php if ( $order_by == 0 ): ?>selected<?php endif; ?>><?php _e( 'Name', 'collapsing-category-list' ); ?></option>
<option value="1" <?php if ( $order_by == 1 ): ?>selected<?php endif; ?>><?php _e( 'Slug', 'collapsing-category-list' ); ?></option>
</select>
</p>
<p><label for="<?php echo $this->get_field_id('img_collapse'); ?>"><?php _e( 'Image to collapse:', 'collapsing-category-list' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id('img_collapse'); ?>" name="<?php echo $this->get_field_name('img_collapse'); ?>" type="text" value="<?php echo $img_collapse; ?>" /></p>
<p><label for="<?php echo $this->get_field_id('img_expand'); ?>"><?php _e( 'Image to expand:', 'collapsing-category-list' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id('img_expand'); ?>" name="<?php echo $this->get_field_name('img_expand'); ?>" type="text" value="<?php echo $img_expand; ?>" /></p>
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('use_class'); ?>" name="<?php echo $this->get_field_name('use_class'); ?>"<?php checked( $use_class ); ?> />
<label for="<?php echo $this->get_field_id('use_class'); ?>"><?php _e( 'To display the icons use CSS classes instead of images', 'collapsing-category-list' ); ?></label>
<p><label for="<?php echo $this->get_field_id('remove_link_for_categories'); ?>"><?php _e( 'Remove link of categories by title (separeted with commas):', 'collapsing-category-list' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id('remove_link_for_categories'); ?>" name="<?php echo $this->get_field_name('remove_link_for_categories'); ?>" type="text" value="<?php echo $remove_link_for_categories; ?>" /></p>
<p><label for="<?php echo $this->get_field_id('hide_categories'); ?>"><?php _e( 'Hide categories by title (separeted with commas):', 'collapsing-category-list' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id('hide_categories'); ?>" name="<?php echo $this->get_field_name('hide_categories'); ?>" type="text" value="<?php echo $hide_categories; ?>" /></p>
<p><label for="<?php echo $this->get_field_id('not_collapse'); ?>"><?php _e( 'Not collapse the following categories by title (separated with commas):', 'collapsing-category-list' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id('not_collapse'); ?>" name="<?php echo $this->get_field_name('not_collapse'); ?>" type="text" value="<?php echo $not_collapse; ?>" /></p>
<?php
}
}
// Make a filter what modify the categories list
function my_filter_widget_categories( $args ) {
$walker = new Walker_Category_Modify();
$args = array_merge( $args, array( 'walker' => $walker ) );
return $args;
}
add_filter( 'widget_categories_args', 'my_filter_widget_categories' );
// Add the javascript file.
function my_init() {
if ( !is_admin() ) {
wp_enqueue_script( 'the_js', plugins_url( '/js/dropdown.js',__FILE__ ), array( 'jquery' ) );
wp_enqueue_style( 'collapscatlist_css', plugins_url( 'collapsing-category-list/' ).'collapsing-category-list.css' );
}
}
add_action( 'init', 'my_init' );
// Register the categories widget
function register_categories_widget() {
unregister_widget('WP_Widget_Categories');
register_widget('WP_Widget_Collaps_Categories');
}
add_action( 'widgets_init', 'register_categories_widget');
// Register translations
function collapsing_category_list_translations() {
$plugin_dir = basename(dirname(__FILE__)) . '/languages';
load_plugin_textdomain( 'collapsing-category-list', false, $plugin_dir );
}
add_action('plugins_loaded', 'collapsing_category_list_translations');
?>
]]>
url is a development site https://friendsofcms.org/cms2 – I don’t want it indexed
Problem is that when you mouse over a category link it creates a pop out box which shows code of anything in the category description box eg. the image url wp-imgage/xxxx.jpg
It would be fine if it showed the real image or text but it’s showing code.
How to fix?
]]>Hi
Since updating to 4.9 and the most recent plugin update, my site no longer loads. I have tried disabling all other plugins and using a default WP theme, but the site will still not load, however on disabling the plugin it loads within a maximum of 5s.
Using GTMetrix, I get an average of 5-9seconds load time. If I enable the plugin, GT Metrix times out.
]]>Hello,
on a multisite configuration, in the backend I have errors showing in posts parts.
When I write a new or edit an existing post, I have two blocks “categories” in the right col, instead of one. Both block are the same.
The first is ok, the second block is showing errors in it :
Warning: array_key_exists() expects parameter 2 to be array, boolean given in mywebsite\wp-content\plugins\collapsing-category-list\classes\class-walker-category-checklist.php on line 127
Warning: array_key_exists() expects parameter 2 to be array, boolean given in mywebsite\wp-content\plugins\collapsing-category-list\classes\class-walker-category-checklist.php on line 41
I have both errors for each categories
Thanks
]]>Hi,
Is it possible for this to become a filter when viewing posts? For example, if I were to select 3-4 child categories, only the posts that fall under that category would appear. (More specifically, every time I select a new category, the page would automatically display those posts, if I deselect a category, the associated posts would disappear without having to hit refresh.)
]]>Wish it worked better!
I am getting this error when installing
collapsing-category-list/libraries/admin_page_framework/factory/admin_page/_model/delegate/validaor/AdminPageFramework_Model__FormSubmission__Validator__Redirect.php
hope you can help ??
]]>After installing the most recent update, I was unable to gain access to my website. I received the following message in my browser:
Fatal error: Class ‘AdminPageFramework’ not found in /home/shopn425/public_html/wp-content/plugins/collapsing-category-list/classes/adminPageClass.php on line 3
Was told that it was not compatible; with my Theme (Virtue v. 2.8.5).
Suggestions?
]]>Just recently installed the Collapsing Category List plugin which seems to work great, but only on the home page and 2-3 other pages of the website. When navigating to most other pages on the website, there is no indication that the plugin is functional.
I have inserted the widget into Footer Column 3 of my theme (Virtue by Kadence Themes). which I assumed affects every page on the website but as indicated, apparently works only a few select pages at this time.
I have attempted to unravel the mystery by configuring various settings adjustments including clearing the cache (I use the latest version of caching plugin called Cache Enabler by KeyCDN) but so far, no success. Any other suggestions?
The website can be viewed at https://www.shopndeliver.ca
Thank you in advance for your time, effort and support in helping assist me to resolve this matter.
Hola Jose!
Outstanding plugin. Is there an easy way to create a shortcode for this which I can insert into a page template? I want to make this style of categories my contents page. Muchas gracias, Jim
]]>The categories of the current post are automatically expanded, how can I edit to keep them collapsed everywhere unless the user manually expands them?
]]>Your zip file was packed with two layers of plugin directory name
]]>Hi Support
i am trying to add collapsing category widget to my shop page with product category and products list. but it doesnot show the list of categories and products on front end. can you please check and let me know.
Hi,
I tries to use the plugin which seems interesting and widely parametrable.
I get an empty widget (just title) and the debug option sends :
MySQL server version:
collapsCat options:
Array
(
[title] => Arbre des Catégories
[showPostCount] => 1
[inExclude] => include
[inExcludeCats] =>
[showPosts] => 1
[showPages] =>
[linkToCat] =>
[olderThan] =>
[excludeAll] => 0
[catSortOrder] => ASC
[catSort] => catName
[postSortOrder] => ASC
[postSort] => postTitle
[expand] => 0
[defaultExpand] =>
[debug] => 1
[postTitleLength] => 100
[catfeed] =>
[taxonomy] => both
[post_type] => post
[postDateAppend] => after
[postDateFormat] =>
[showPostDate] =>
[useCookies] =>
[postsBeforeCats] =>
[expandCatPost] =>
[showEmptyCat] => 1
[showTopLevel] =>
[customExpand] =>
[customCollapse] =>
[style] => kubrick
[accordion] => 0
[title_link] =>
[addMisc] =>
[addMiscTitle] =>
[number] => 2
[includeCatArray] => Array
(
)
[expandSym] => ?
[collapseSym] => ▼
)
postsToExclude:
Array
(
)
CATEGORY QUERY:
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN
wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN
('category','post_tag') AND t.slug!='blogroll'
ASC
CATEGORY QUERY RESULTS
WP_Error Object
(
[errors:WP_Error:private] => Array
(
[invalid_taxonomy] => Array
(
[0] => La taxinomie est invalide
)
)
[error_data:WP_Error:private] => Array
(
)
)
POST QUERY:
select ID, slug, date(post_date) as date, post_status,
post_type, post_date, post_author, post_title, post_name, name, object_id,
t.term_id from wp_term_relationships AS tr, wp_posts AS p,
wp_terms AS t, wp_term_taxonomy AS tt
WHERE tt.term_id = t.term_id
AND object_id=ID
AND post_status='publish'
AND tr.term_taxonomy_id = tt.term_taxonomy_id
AND tt.taxonomy IN ('category','post_tag') AND post_type='post' ORDER BY p.post_title ASC
POST QUERY RESULTS
Array
(
[0] => stdClass Object
(
[ID] => 335
[slug] => doc_notes_ebauche
[date] => 2015-01-15
[post_status] => publish
[post_type] => post
[post_date] => 2015-01-15 16:46:33
[post_author] => 1
[post_title] => (test) Affichage de structure de catégorie
[post_name] => test-affichage-de-structure-de-categorie
[name] => Brouillon - notes - ébauche
[object_id] => 335
[term_id] => 22
)
[1] => stdClass Object
(
[ID] => 335
[slug] => test_mise_en_page
[date] => 2015-01-15
[post_status] => publish
[post_type] => post
[post_date] => 2015-01-15 16:46:33
[post_author] => 1
[post_title] => (test) Affichage de structure de catégorie
[post_name] => test-affichage-de-structure-de-categorie
[name] => Test de mise en page (publication admin)
[object_id] => 335
[term_id] => 27
)
[2] => stdClass Object
(
[ID] => 335
[slug] => brouillon
[date] => 2015-01-15
[post_status] => publish
[post_type] => post
[post_date] => 2015-01-15 16:46:33
[post_author] => 1
[post_title] => (test) Affichage de structure de catégorie
[post_name] => test-affichage-de-structure-de-categorie
[name] => Brouillon
[object_id] => 335
[term_id] => 125
)
[3] => stdClass Object
(
[ID] => 335
[slug] => test-de-mise-en-page
[date] => 2015-01-15
[post_status] => publish
[post_type] => post
[post_date] => 2015-01-15 16:46:33
[post_author] => 1
[post_title] => (test) Affichage de structure de catégorie
[post_name] => test-affichage-de-structure-de-categorie
[name] => Test de mise en page
[object_id] => 335
[term_id] => 126
)
[4] => stdClass Object
(
[ID] => 335
[slug] => structure-categories
[date] => 2015-01-15
[post_status] => publish
[post_type] => post
[post_date] => 2015-01-15 16:46:33
[post_author] => 1
[post_title] => (test) Affichage de structure de catégorie
[post_name] => test-affichage-de-structure-de-categorie
[name] => structure catégories
[object_id] => 335
[term_id] => 127
)
)
Do these data trace contains useful information about errors somewhere ?
Or the elements for the solution ?
Best regards
Trebly
Thanks
I loved your plugin. Fantastic!
It is working except tha even if I want to hide some cats, they still been displayed.
Example: <Uncategorized> cat #1 is still displayed. I tried to hide also the blog + slider cats = still been displayed.
Any solutions?
Thanks
Roger Pilon, Editor
The Planet Fixer Digest
This looks great and I could use it to replace a plugin that’s not working on WP 4.0.
Please reply when it is updated to work with WP 4.0 so I would be notified.
Thank you!
JF
Hi,
where i could edit the style of this plugin? Font sizes, for example
Thanks
]]>Hi!
How to make a plugin to show the category taxonomy?
Thanx for a great plugin, i really like it. However, it seems to generate an enormous amount of code in the page source. I have about 100 different categories at the moment, and just the .html file alone is over half a mega byte in size! Since i’m planning to have thousands of categories, this can not continue of course. Do you have a solution to this problem?
My website is craftersu.com
]]>Is it possible to throw some categories from the list? And that remove / category / example autoknjiga.com / category / ac / in the end remains just autoknjiga.com / ac /
autoknjiga.com is the site.
]]>Hi! Thanks for the useful plugin ??
The problem is this – there are 5 categories with subcategories, the last of them is deployed, the upgrade page.
Want that all categories were collapsed.