Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7016367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:46:32+00:00 2026-05-27T22:46:32+00:00

I have a photo gallery I’m developing using WP as a means for content

  • 0

I have a photo gallery I’m developing using WP as a means for content management. I’m relying heavily on some jQuery plugins to manage the UI styling and manipulation (via sorting). My problem is there are too many damn posts! 737, and each has a thumbnail which is displayed on the page. This inevitably bogs down any browser. Especially since the sorting plugin “clones” the images when it sorts them.
The posts are built using a Wp_query script;

<?php
  $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  $post_per_page = 15; // (-1 shows all posts) SETS NUMBER OF IMAGES TO DISPLAY!
  $do_not_show_stickies = 1; // 0 to show stickies
  $args=array(
    'post_type' => array ('post'),
    'orderby' => 'rand',
    'order' => 'ASC',
    'paged' => $paged,
    'posts_per_page' => $post_per_page
  );
    $pf_categorynotin = get_post_meta($wp_query->post->ID, true);
    if($pf_categorynotin){
        $args['tax_query'] = array(
            array(
                'taxonomy' => 'category',
                'field' => 'slug',
                'terms' => $pf_categorynotin,
                'operator' => 'NOT IN'
            )
        ); //category__in
    }
  $temp = $wp_query;  // assign orginal query to temp variable for later use
  $wp_query = null;
  $wp_query = new WP_Query($args);
  //Begin LOOP #1
  if( have_posts() ) :
        echo '<ul id="applications" class="applications pf_item3">';
        $r = 0;
        while ($wp_query->have_posts()) : $wp_query->the_post();
            $post_cat = array();
            $post_cat = wp_get_object_terms($post->ID, "category");
            $post_cats = array();
            $post_rel = "";
            for($h=0;$h<count($post_cat);$h++){
                    $post_rel .= $post_cat[$h]->slug.' ';
                    $post_cats[] = $post_cat[$h]->name;
                }
        $r++;
        echo'<li data-id="id-'. $r .'" data-type="'.$post_rel.'" >';
        if (get_post_meta($post->ID, 'port_thumb_image_url', true)) { ?>
    <a  class="tozoom" href="<?php echo get_post_meta($post->ID, 'port_large_image_url', true); ?>" rel="example4" title="<?php echo $post->post_title; ?>">
    <img src="<?php echo get_post_meta($post->ID, 'port_thumb_image_url', true); ?>" class="portfolio_box" alt="<?php the_title(); ?>" width="199px" height="134px" /></a>
        <?php } ?>
            </li>
        <?php endwhile ?>
             </ul>

and the items are sorted by their html5 tags with a menu in the sidebar.

You can see it working here;
http://marbledesigns.net/marbledesigns/products

Right now it randomly loads 15 posts and displays them. I want to be able to reload posts based on my selection from the menu (via categories) and then update the list of images without refreshing the page. I want to be able to change not only which posts from which category are displayed, but also the posts per page as well.

I think AJAX is the way to do this, but I don’t want to undo a whole bunch of code in the menu in order to get it working. Right now the menu is styled radio buttons. Isn’t there a way I can take the same input from that form and update the parameters of the loop?

Looking for an efficient solution! Please help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:46:32+00:00Added an answer on May 27, 2026 at 10:46 pm

    I’m going to abandon this method for reasons of time restriction. I’ve decided to use AJAX as a way to pull the list form the linked page and display it on the current one.

    I followed this tutorial,
    http://www.deluxeblogtips.com/2010/05/how-to-ajaxify-wordpress-theme.html
    changed a couple names in the ajax.js script and it worked great!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application with a UITabBar. I have implemented a Photo Gallery using
I have created a photo gallery application using Three20 framework. It works fine with
I have the following code I am using for a photo gallery. In Internet
I am creating a photo gallery using jquery. I am taking and resizing the
I have a dynamically produced photo gallery using ASP. Each photo is contained by
I have photo gallery code that does image re-sizing and thumbnail creation. I use
I have a photo gallery web page where a single <img src="XXX" /> element's
I have a photo gallery I would like that every time a user does
I have a photo gallery I'm trying to set a picture as the cover
I have a PHP photo gallery that reads the GPS coordinates from images. I'd

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.