Find freelancers. Lose those costly delays.

With 1.7 million freelancers, we'll match you with the perfect talent.

or, Register with Elance »

create a variable for Wordpress query
Sign in to Add to Watch List

IT & Programming > Web Programming

View Change History

The client has made the following changes to the job.


Job awarded.

Jul 9, 2014

Job Description

  |  Change History >>


Invite-Only Job
  • Posted: Wed, Jul 09, 2014
  • Time Left: Closed
  • Location: Anywhere
  • Client prefers freelancers from:

    You are still able to submit a proposal for this job.

    The client prefers freelancers from
    a different location.

    You're still able to submit a proposal for this job, regardless of your location.
  • Start: Immediately
  • Budget: Less than $500
  • Fixed Price Job
  • Elance Escrow Protection
  • U.S. freelancers must have W9
Sign in to view client's details

I have a custom post type with a slug name that matches the category slug of regular posts. I want a custom Wordpress query that display only posts with categories that match the custom post type.

Everything has been created and put in place except a query that gets the category_name from a variable which matches the slug of the custom post type like below?

//custom post type = sport

<?php $args = array ('post_type' => 'post', 'category_name' => $sport,);
$query = new WP_Query( $args ); ?>
<?php if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); ?>

Sign in or Register to see more

Desired Skills
MySQL Administration, HTML, PHP
Job ID: 59276905
Avg $ | High $ | Low $ — Show Pricing
  • Submit Date (Latest)

 Vietnam  |  
I have good experience with HTML, HTML5, JQuery, javascript and Wordpress.
 5.0   |  Private   |  45 Jobs
Bid ID: 59277238  |  Submitted: Jul 9, 2014 01:17 ET 
Within 1 day
Elance is now an Upwork company.
Upwork is the choice of 4M+ clients. Get started working on Upwork today.
Are you ready to post a job like this one?
Post a Similar Job »