Wordpress Image Gallery plugin Needed

Posted on 2011-10-08
Last Modified: 2012-05-12
Hi all,

I am looking into inserting some images into a wordpress page where to images would be the Categories and when clicked it would link to a gallery of sub images

For example on the page you get the category: "Florida Images" and when I click on the image it will show all the floria images.

Does anyone know of any Wordpress plugin that works this way?

Question by:error77
    1 Comment
    LVL 23

    Accepted Solution

    I don't know how may posts you have that already exist, but this sounds like a perfect use for Custom Post Types and Taxonomies. Basically you could set up custom post types for your categories and the images would be the post thumbnails that were in the Custom Post Type category. You could use the taxonomies as sub-cat's or tags etc...

    Here is a link to some good info about custom post types:
    Custom Post Type UI Plugin

    Justin Tadlock on Custom Post Types:

    Here is a quick start I've put together using several resources and combing them into one that adds a custom post type, taxonomy and takes care of the re-writes:

    Step one:
    I make a new page template and name it portfolio-options.php and add my options for the custom post type:
    add_action('init', 'create_portfolio');
      function create_portfolio() {
        $portfolio_args = array(
            'label' => __('Portfolio'),
            'singular_label' => __('Portfolio'),
            'public' => true,
            'show_ui' => true,
            'capability_type' => 'post',
            'hierarchical' => false,
            'rewrite' => true,
            'supports' => array('title', 'editor', 'thumbnail')
        register_post_type('portfolio', $portfolio_args);
    add_action("admin_init", "add_portfolio");
    add_action('save_post', 'update_website_url');
      function add_portfolio(){
        add_meta_box("portfolio_details", "Portfolio Options", "portfolio_options", "portfolio", "normal", "low");
    function portfolio_options(){
      global $post;
             $custom = get_post_custom($post->ID);
             $website_url = $custom["website_url"][0];
        <div id="portfolio-options">
          <label>Website URL:</label><input name="website_url" value="<?php echo $website_url; ?>"/>
        </div><!--end portfolio-options-->
      function update_website_url(){
        global $post;
        update_post_meta($post->ID, "website_url", $_POST["website_url"]);
    add_filter("manage_edit-portfolio_columns", "portfolio_edit_columns");
    add_action("manage_posts_custom_column", "portfolio_columns_display");
      function portfolio_edit_columns($portfolio_columns){
        $portfolio_columns = array(
            "cb" => "<input type=\"checkbox\" />",
            "title" => "Project Title",
            "description" => "Description",
        return $portfolio_columns;
    function portfolio_columns_display($portfolio_columns){
      switch ($portfolio_columns) {
            case "description":

    Open in new window

    Step 2:
    Create a page templage named portfolio.php with this code:
    Template Name: Portfolio
    get_header(); ?>
    <div class="maincontent"><!--Main content begin-->
    <div class="mainshellleft">
      <?php $loop = new WP_Query(array(
      'post_type' => 'portfolio', 
      'posts_per_page' => 10 )
          while ( 
            $loop->have_posts() ) : 
            $custom = get_post_custom($post->ID);
      <div class="singlepost">
        <div class="posttitle"><h2><?php the_title(); ?></h2></div>
          <div class="postinfoblog">
            <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
          <div class="singleblogimg">
            <div class="mosai-block-blog">  
        <a href="<?php the_permalink(); ?>" title="<?php the_title();?>"><?php the_post_thumbnail(); ?></a>
        <div class="posttextblog readmore">
          <div class="posttextblog"><?php the_excerpt(); ?></div>
      </div><!-- SINGLEPOST -->
    <?php endwhile; ?>  
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Open in new window

    Both these files would go in the root of your themes folder.

    Step 3:

    Include the portfolio-optons.php in your themes functions.php file:
    include_once( dirname( __FILE__ ) . '/portfolio-options.php' );

    Open in new window

    Step 4:
    Add a custom post thumbnail size for your custom post type (in this case portfolio.php):
    add_theme_support( 'post-thumbnails' );
    add_image_size('portfolio_wide', 680, 280, true);

    Open in new window

    The first line is just the standard for allowing post-thumbnails in your theme. Make sure it doesn't already exist if you use the code above.

    Step 5:
    Create a page that is named whatever your category will be and assign the new page template to it.
    You'll also need to go to the Settings>Permalinks and click update for the new URL's to work correctly.

    That sounds like a lot, but when you figure it out it's worth it.

    Let me know if you have any questions.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchiā€¦
    The viewer will learn how to count occurrences of each item in an array.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now