WordPress.org

Forums

Shortcode Exec PHP
Simple Index page organised by category. (1 post)

  1. Rogad
    Member
    Posted 2 years ago #

    Thanks to the developer for the php wizardry - very nice.

    Here's a bit of code I wrote which was really easy to implement with this plugin. Will donate, when I get paid.

    $categories = get_categories();
    
    foreach($categories as $category){
    
    	echo '<h3>' , $category->name , '</h3>';
    
    	$posts = get_posts(array('category' => $category->cat_ID, 'order'=> 'ASC', 'orderby' => 'title', 'numberposts' => -1));
    
    	echo '<ul>';
    
    	foreach($posts as $post) {
    		echo '<li><a href="' , get_permalink( $post->ID ) , '">' , $post->post_title , '</a></li>';
    	}
    
    	echo '</ul>';
    }

    http://wordpress.org/extend/plugins/shortcode-exec-php/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Shortcode Exec PHP
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by Rogad
  • This topic is not a support question
  • WordPress version: 3.4.2

Tags

No tags yet.