• This post is regarding: GLM’s Category Magic Plugin
    http://www.ax697.org/category-magic-on-wordpress-200765.html

    I’m trying to edit GLM’s Category Magic Plugin, so that I can modify the output to including data that is in my custom fields, more specifically a different title and a thumbnail image.

    Below is the relevant code from the beginning, to the end of the segment I’m modifying. How do I modify this plugin code, to get the data for the fields Image and name, and then echo that data into the output area?

    Thanks

    —————————–

    function glmdobcat() {
    $arg_list = func_get_args();
    $cat_ID1 = $arg_list[0];
    $cat_ID2 = $arg_list[1];
    $numposts = $arg_list[2];
    $catquery1 = 'numberposts=1000&category='.$cat_ID1; //sets up the query for id1
    $catposts1 = get_posts($catquery1); //gets the posts from category id1
    $catquery2 = 'numberposts=1000&category='.$cat_ID2; //sets up the query for id1
    $catposts2 = get_posts($catquery2); //gets the posts from category id1
    $metaimage = wp_get_post_meta($Image);
    $count=0;  //sets the count to zero
    $permid1 = array(); //defines permid1 as an array
    $glmpostarray= array();
    $count2=1;
    if (empty($numposts))
    $numposts='5';
    foreach($catposts1 as $post1) :   //starts looping from the posts from query1
    	$permid1[$count] = get_permalink($post1); //stores permlink from each post
    
    	foreach($catposts2 as $post2) :  //starts looping from the posts from query1
     	 $permid2 = get_permalink($post2); //stores permlink from each post
    	   	  if ($permid2 == $permid1[$count]) {  //checks if permlink is same
    		 				$glmpostarray[$count2] = '<ul><li><a href="'.get_permalink($post2).'">'.$post2->post_title.'</a></li></ul>';
    			$count2++; }
       	endforeach;
    
    	$count++; //increments the counter
    endforeach;
    
    if ($numposts > $count2)
    $numposts = $count2; 
    
    for ($i=1; $i<=$numposts; $i++)
    echo $glmpostarray[$i];
    
    }

The topic ‘Modifying Custom Magic Plugin to use Custom Field Data’ is closed to new replies.