ashwinnaidu
Forum Replies Created
-
Forum: Plugins
In reply to: Custom Registration for WordPressanyone?
Forum: Fixing WordPress
In reply to: Get posts with WP_Query by postnamelovely, thanks very much. ??
Forum: Fixing WordPress
In reply to: Get posts with WP_Query by postnameI have two select fields(one for metakey/value and one for category) one input field(for post name) in a custom search page.
I have written the code for both
<?php
$location = $_POST[“location”];
$product = $_POST[“product”];
$category = $_POST[“cat”];
$catname = get_cat_name($category);
?><!– if custom field location is mentioned Category is not Mentioned –>
<?php
if($location!=”All” && $category==0) {
$query = “meta_key=specs&meta_value=” . $location;
$my_query = new WP_Query($query); ?><?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<!– if category and location both are mentioned –>
<?php
if($category!=0 && $location!=”All”) {
$query = “meta_key=specs&meta_value=” . $location . “&category_name=” . $catname;
$my_query = new WP_Query($query); ?><?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
Now, I need to get posts based on postname($product) and from a specific category($catname). Also, based on postname and the post with the give meta_key/value pair. Lastly all three.
Forum: Fixing WordPress
In reply to: Get posts with WP_Query by postnameCan I add category_name, meta_key=specs&meta_value=, in the args ?
regards,
Ashwin.Forum: Fixing WordPress
In reply to: Get posts with WP_Query by postnameThanks Michael.
Forum: Plugins
In reply to: Navigation in PagesIt’s not just a page, It’s a page with loop.
Forum: Your WordPress
In reply to: How to get thumbnail attachmentanyone !!
Forum: Plugins
In reply to: [Plugin: Regenerate Thumbnails] Will be updated for WP 2.8?I’m using WP 2.8.1, the plugin is not working. The script is not executing at all.
Forum: Themes and Templates
In reply to: one post from a specific categorynot working for me..
Forum: Themes and Templates
In reply to: one post from a specific categoryI’m using the code on the index page before the loop. I don’t want a list of posts. I am trying to pull the permalink of the latest post from a specific category.
Forum: Fixing WordPress
In reply to: WordPress Tags as Meta KeywordsYes I am using that plugin as of now. But, I want to hard code it into the template.
Forum: Plugins
In reply to: 404 errors on page 2 of category pageyeah.. you are right moshu, I got the pagination thing to work but, the posts are repeating over and over again.. on all the pages.. ??
Is there any way at all to change the category url structure..
Forum: Plugins
In reply to: 404 errors on page 2 of category pageHey,
I figured out a way to solve this pagination problem on some forum.
here’s the solution to those have the same problem.go to wp-includes/classes.php
find
if ( isset($error) )
$this->query_vars[‘error’] = $error;under it you need to place the following
if (@$this->query_vars[“name”] == “page”)
{
$tmp_ar = $this->query_vars;
$this->query_vars = array();
$this->query_vars[“paged”] = str_replace(“/”, “”, $tmp_ar[“page”]);
$this->query_vars[“category_name”] = $tmp_ar[“category_name”];
}