Ready to get started?Download WordPress


Eazyest Gallery
[resolved] Subfolders in submenu (5 posts)

  1. Martijn
    Posted 1 year ago #


    Is it possible to show subfolders only after a visitor clicks a main item in the main category?
    I have a lot of subfolders now, so that the menu is very expansive: see kleurplatennl [ dot ] nl.

    I would like this to work like http://www [dot] supercoloring [dot] com/



  2. klihelp
    Plugin Author

    Posted 1 year ago #

    Hope this function helps:

    my_ezg_subfolders_links( $postID, 'hash', 'data-any:"thing"' )

    /* my_ezg_subfolders_links()
    * post_id - parent post id
    * type - hash OR no-hash
    * data - include additional attributes string
    function my_ezg_get_subfolders_links( $post_id = 0, $type = 'no-hash', $data = '' ) {
    	$output = '';
    	list( $orderby, $order ) = explode( '-', eazyest_gallery()->sort_by() );
    	$children = get_children( array(
    		'numberposts' => -1,
    		'post_parent' => $post_id,
    		'post_type'   => eazyest_gallery()->post_type,
    		'order' => $order,
    		'orderby' => $orderby,
    		'post_status' => array( 'publish', 'inherit' )
    	foreach ( $children as $post ) {
    		$output .= "<li><a href=". ( $type == 'hash' ? $post->guid : "#{$post->post_name}");
    		$output .= " data-id= $post->ID ";
    		if ( $type == 'hash' )
    			$output .= " data-href= $post->guid ";
    		if ( $data )
    			$output .= " {$data}";
    		$output .= ">{$post->post_title}</a></li>";
    	return $output;
    function my_ezg_subfolders_links( $post_id = 0, $type = 'no-hash', $data = '' ) {
    	echo my_ezg_get_subfolders_links( $post_id, $type , $data );
  3. Martijn
    Posted 1 year ago #

    Can you help me where to put the code?

    I also tried the Folding Category List plugin, but this is only working for the standard WP categories.

  4. klihelp
    Plugin Author

    Posted 1 year ago #

    You put the code part into the functions.php.
    And you call the function in your theme, in the header.php but this is depends of your design. This function only outputs the subfolders in a raw html list, ready to use programatically.

  5. Martijn
    Posted 1 year ago #

    I am using the theme that I want now (plaintxtBlog), but I have no clue how to actually program this.
    I would be very grateful to get some help.

    The standard Eazyest subfolder menu is used now, but it is way too long. Also I tried to move all of the images of the subfolders to the main folder, but then it will be a chaos inside the folders.

    Thanks for you help.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic