Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • For instance (because people require examples.. like myself)

    add_filter('the_title','add_field');
    
    function add_field($title)
    {
    global $id;
    if (in_category('1') && $id) {
    	global $post;
    	$key = "location";
    	$data = get_post_meta($post->ID,$key,true);
    global $wp_query;
    //print_r($wp_query);
    
    	return $title."</a><br /><div style='font-size:10px;line-height:120%;padding-top:3px'>".$data."</div><a>";
    
        }
    else {
    	return $title;	
    
    }
    }

    Check out wp-includes/classes.php. Here’s something I tossed into Walker::start_el():

    $mycat=$category->term_id;
    			$anychildren=get_categories('child_of='.$mycat);
    			if (!$anychildren) { $postquery = query_posts('cat=' . $category->term_id .'\''); 
    
    				$endnodelist .= '<ul>';
    				if ( have_posts() ) : while ( have_posts() ) : the_post();
    				$endnodelist .= '<li>' . get_the_title() . '</li>';
    				endwhile;
    				endif;
    				$endnodelist .= '</ul>';
    
    			}

    And finally

    $link .= $cat_name .'</a>' . $endnodelist;.

    Hope it helps – enjoy!

    Cheers
    Jacob

Viewing 2 replies - 1 through 2 (of 2 total)