amp343
Forum Replies Created
-
Forum: Plugins
In reply to: Sort by custom field not workingHm, I think this has something to do with my meta values being numerical — anyone else experience this?
Forum: Plugins
In reply to: Custom select queryGood call, that makes sense now. Is there an easy way to see the SQL that the query functions generate? That might make this easier for future reference.
I figured I would run in to some issues with the duplicate post slugs — that apparently being one of them — but I’m hoping the query I have pulling the post now will work reliably.
I hope trying to keep this format up with duplicate post slugs doesn’t end up being a foolish endeavor; I’ve only really come across one other answer about how to do it in WP: Don’t!
Thanks again for the help.
Forum: Plugins
In reply to: Custom select queryHi Michael,
Thanks so much for the help, but for some reason query_posts wasn’t liking those arguments. It would always return the posts by name (slug), seemingly disregarding the ‘cat’ parameter. Since there were multiple posts for a given slug, this would return multiple posts rather than just the desired one. Also, showposts and posts_per_page seemed to be disregarded as well.
Could this be because slug is supposed to be unique, so its category shouldn’t matter (as far as the function is concerned?)
Anyway, I posted the hack/workaround that seems to be working for the moment above…
I don’t have much experience playing with databases, so what I have there is pieced together from other stuff that I’ve read online.
Forum: Plugins
In reply to: Custom select queryHere’s what I came up with so far… not sure if this is really legit / going to work in the end, but it seems to be fore the time being!
$querystr =" SELECT wposts.* FROM $wpdb->posts wposts LEFT JOIN $wpdb->term_relationships tr ON (wposts.ID = tr.object_id) LEFT JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) LEFT JOIN $wpdb->terms t ON (tt.term_id = t.term_id) WHERE wposts.post_name = '$postname_var' AND t.term_id = $this_cat_ID_var " ;(postname and cat id having already been determined and stored as vars prior to running the query)
Forum: Plugins
In reply to: Custom select query… Or could you get the post ID from its title and category, then just use query_posts with that unique ID?
Forum: Plugins
In reply to: Custom select queryIs it possible to use this to retrieve a post based on a combination of slug and category?
I know you should be able to get the post by slug alone, but the database I’m working with has some duplicate entries for slugs, so it returns more than one post. I was thinking that by querying the post slug and category id, it would narrow down the selection since that would return one result only. However, query_posts breaks when I try to do this…
Forum: Plugins
In reply to: Change permalink build?or even the category description?
Forum: Plugins
In reply to: Change permalink build?… a new, unique field
Forum: Requests and Feedback
In reply to: Bug: Cannot have duplicate category and tag slugsyikes.. looks like the slug must be unique in the table wp_terms
Forum: Plugins
In reply to: unique permalinks and reusing slugsugh, I implemented an extremely roundabout hack to take care of this issue:
In wp-admin/posts.php, a check to see if the slug is being appended by the -2, -3 numerals.
If it is, truncate it before the appendage, then store it as usual.
But of course these posts don’t play nice in the loop after this. To get around this, I had to include a custom query in my single.php. I get the post as normal (by slug) — but of course now there are multiple posts with the same slug, so it’s screwy.
In order to make sure I get the post I want, I grab the url, and identify the lowest child category from the permalink (what the template should be displaying). Then I get the lowest child category of the posts in question (there shouldn’t be more than one similarly-named post in any given subcategory) and compare each’s category ID to that of the one from the URL.
If they match, that means it’s the post that’s intended to be there.
…extremely ugly, but it seems to work!
Forum: Requests and Feedback
In reply to: Bug: Cannot have duplicate category and tag slugsAny idea where to screw up the auto-formatting?
Forum: Requests and Feedback
In reply to: Bug: Cannot have duplicate category and tag slugsThis is lame… does anybody have a workaround or any advice how to edit the auto-formatting in the backend?
Forum: Plugins
In reply to: unique permalinks and reusing slugsAny word on this? A plugin, or a fix to go in and edit the function that creates the slug-2, slug-3 instances?
The urls of my site are never going to change (ie, no 2 similarly-named posts will ever be in the same category, etc), so I would prefer to be able to use the same slug for multiple posts.
Thanks
Forum: Plugins
In reply to: [Plugin: really static] Best Plgun Better than Wp-CacheI keep getting 0kb files written by Really Static…
It says in the FAQ that this is due to incorrect settings, but I’m not sure what’s wrong.
Does anybody have advice about setting up the Really Static settings correctly?
Forum: Fixing WordPress
In reply to: does Google frown upon %postname%.html permalinks?… in other words, does Google frown upon being “tricked” this way?