Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter cavanaughb

    (@cavanaughb)

    Your code seems to be working perfectly–I just didn’t specify the conditional if statement correctly.

    This appears to be working. I will follow-up with more tests over the weekend. Once again, thank you for a great plug-in.

    } elseif($show_categories == "yes"){
    		if($child_of = "page_ID"){

    …where page_ID equals the identification number of the parent page.

    Thread Starter cavanaughb

    (@cavanaughb)

    Thank you for the link! I’m testing the following code, but my page is still showing ALL pages of the site-map, instead of the child pages. Do you any have ideas?

    /* ===== set up what to get (tags, categories, etc...) ===== */
    	if($taxonomy){
    		$tags = get_terms($taxonomy, 'order=ASC&hide_empty='.$show_empty.'');
    	} elseif($show_categories == "yes"){
    		if($child_of != ""){
    			$childof = array();
    			$childof = preg_replace('/\s+/', '', explode(',',$child_of));
    			$tags = array();
    			foreach($childof as $kids){
    				$args = array(
    					'child_of' => $kids,
    					'order' => 'ASC'
    				);
    				$childcats = get_categories($args);
    				$tags = array_merge($tags, $childcats);
    			}
    		} else {
    			$tags = get_categories('order=ASC&hide_empty='.$show_empty.'');
    		}	
    
    	 	} elseif($show_pages == "yes"){
    		if($child_of != ""){
    			$childof = array();
    			$childof = preg_replace('/\s+/', '', explode(',',$child_of));
    			$tags = array();
    			foreach($childof as $kids){
    				$args = array(
    					'child_of' => $kids,
    					'order' => 'ASC'
    				);
    				$childcats = get_pages($args);
    				$tags = array_merge($tags, $childcats);
    			}
    		} else {
    			$tags = get_pages('sort_order=ASC&hide_empty='.$show_empty.'');
    		}
    	} elseif($from_category){
    		$tags = array();
    		$posts_array = get_posts('category='.$from_category.'&numberposts=-1');
    		foreach($posts_array as $pa) {
    			$tags = array_merge($tags, wp_get_post_tags($pa->ID));
    		}
    		$tmp = array();
    		foreach($tags as $k => $v){
        		$tmp[$k] = $v->term_id;
     		}
    		$tmp = array_unique($tmp);
     		foreach($tags as $k => $v){
        		if (!array_key_exists($k, $tmp)){
            		unset($tags[$k]);
    			}
    		}
    	} else {
    		$tags = get_terms('post_tag', 'order=ASC&hide_empty='.$show_empty.'');
    	}
Viewing 2 replies - 1 through 2 (of 2 total)