Passing multiple variables through url (php)

I’m assuming these are the post details the you’re trying to pass through the URL. Not sure if that is the most effective way to go about doing this. I do the same type of thing, but pass the postID through the URL and when I get to the destination page, use the postID to … Read more

Conditional Content Display

You can’t execute PHP code from within a string. You can however define a function that executes code and call that function within your if clauses. function dz_slick_longstring() { $query = new WP_Query(‘category_name=intro-paragraphs’); if($query->have_posts()) : while($query->have_posts()) : $query->the_post(); ?> <div class=”mid-box”> <h1><?php the_title(); ?></h1> <?php echo excerpt(40); ?><br/> <a href=”<?php echo get_permalink(); ?>”>&raquo; read more…</a> … Read more

Building a List of Posts grouped by custom taxonomy as the section header only to be displayed if at least one post is in that tax

You are looping through all states and running a query on each iteration, but the query you are doing is nothing to do with the loop. You are checking for $_GET[‘state’], which would be the state passed over the query string. <?php foreach ( $states as $state ) { $state_query = new WP_Query( array( ‘post_type’ … Read more

Adding code to the function file

If you move the function and the add_filter function to the functions file, the you don’t need to echo the function after. If the function doesn’t involve using add_filter then you could echo out the function in your template file. Placing it in the functions.php file, will run on every page/post load unless specified otherwise.