WordPress.org

Ready to get started?Download WordPress

Forums

ajax page load triggered by wordpress drop down (1 post)

  1. arcosurf
    Member
    Posted 1 year ago #

    i'm pretty new to wordpress and have some very complicated questions (to me anyway). i'm trying to get a page of posts, based on a specific category, to reload in the same area triggered by a drop down action. my current drop down option includes a go button, i'd prefer that submit button not be necessary. i've successfully set up some portions of this but i do not know where to even begin with the ajax code and how it relates to a drop down. can some please help? here is what i'm working with, should further explanation be necessary, i'll try. i have explored http://wordpress.org/extend/plugins/advanced-ajax-page-loader/faq/ and obviously http://codex.wordpress.org/Function_Reference/wp_dropdown_categories

    <div class="blog-filter"><div class="blog-title">RECIPES</div>
    
    	<div class="recipe_bg">
    	<div class="title_line">&nbsp;</div>
    	<div class="filter">
    	<div><div id="all-categories">
    <ul>Categories:<br />
    <form action="<?php bloginfo('url'); ?>" method="get"><?php wp_dropdown_categories('orderby=name&order=ASC&show_count=1&hierarchical=1&show_option_all=Category Archives'); ?><br />
    <input type="submit" name="submit" size="45" value="  Go  " /></form>
    </ul>
    </div>
    <p></div>
    </div>
    <div class="dyn_category_title"><span>APPETIZERS</span></div>
    <div class="category_sort">
    	<ul>
    	<?php
    		$args=array(
    		  'orderby' => 'name',
    		  'order' => 'ASC',
    		  'exclude' => '3,4,5,6,27',
    		  );
    		$categories=get_categories($args);
    		  foreach($categories as $category) {
    			echo '<li><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "Filter %s" ), $category->name ) . '" id="' . sprintf( __( "cat-%s" ),$category->term_id) . '" class="cat" rel="' .$category->term_id. '" ' . '>' . $category->name. '</a>';
    			echo '</li>';  }
    	?>
    	</ul>
    
    	<div class="actions">
    		<a href="#" class="filter_button disabled">Filter</a>
    		<!--<a href="#" class="cancel_button">Cancel</a>-->
    		<span class="expected"></span>
    	</div>
    
    	<script type="text/javascript" charset="utf-8">
    		swissmiss.toolbar();
    			swissmiss.filterCategories();
    	</script>
    </div>	
    
    		<?php
    		//query_posts('cat=appetizers&showposts=4');
    		query_posts( array ( 'appetizers' => 'appetizers', 'posts_per_page' => 4 ) );
    		while(have_posts()):
    		the_post();
    		?>
    
    		<div id="recipe_posts">
    		  <div class="recipe_img"><img src="<?php echo catch_that_image() ?>"></div>
    		  <div class="recipe_details" <?php post_class() ?> id='post-<?php the_ID()?>' >
    			 <h2><?php the_title() ?></h2>
    			 <div><?php the_excerpt(); ?></div>
    			 <a href="<?php the_permalink()?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s','gpp_i18n'),the_title_attribute('echo=0')); ?>"><div class="learn_more_btn"><span>LEARN MORE</span></div></a><br />
    		  </div>
    		</div>
    
    		<?php
    		endwhile;
    		//Reset Query
    		wp_reset_query();
    		?>
    
    	</div>
        </div>
    </div>

Topic Closed

This topic has been closed to new replies.

About this Topic