WordPress.org

Ready to get started?Download WordPress

Forums

Shortcode Exec PHP: No results on page (1 post)

  1. sigmaweb
    Member
    Posted 3 years ago #

    I'm using the Shortcode Exec PHP plugin (v1.22) on a page (WP 3.0.5) and want to display all subcategories of category 10, along with the titles of posts in each category.

    global $wpdb;
     $categories = get_categories("child_of=10"); foreach ($categories as $cat) {
    	echo '<div class="genre_subcat">';
    		query_posts("cat=$cat->cat_ID&showposts=5&order=ASC&orderby=name");
    		echo '<h2>'.single_cat_title().'</h2>';
    		while (have_posts()) : the_post();
    			echo '<div class="post">
    				<h3><a href="'. the_permalink() .'" rel="bookmark" title="Permanent Link to
    				'. the_title_attribute().'" '. the_title() .'</a></h3>
    				</div>';
    		endwhile;
    	echo '</div>';
    }

    I call this [restaurant_listing], but when I put this shortcode on my page, no results show up.

    Any help would be appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic