thhhhh
Forum Replies Created
-
Should this be in functions.php or on the archive page? Currently its in functions.
I’ve got five custom post types on my site with many shared taxonomies, but I was hoping to accomplish something similar to this.
I want to have my site check what post type archive page I am looking at, and then insert that post type at the head of my query.
Here’s what I’ve got in terms of code… using version 1.62 of the plugin.
if ( is_post_type_archive() ) { $CPTquery = get_post_type( $post->name ); } function my_qmt_base_url() { return '../?post_type=' . $CPTquery; } add_filter( 'qmt_base_url', 'my_qmt_base_url' );Despite this code, I’m not seeing the query string affected at all. Any ideas?
Thanks for the reply… I think you may have had a different problem than the one I’m trying to solve. I’ve already built a CPT archive specific to each of my post types, but submitting an empty query seems to just take me to a page built from index.php. I guess my problem is that I’m struggling to find a way to include my CPT in the query string automatically.
Basically, I’ve got a few custom taxonomies (resource_type, topics, timeline) which I want to query within a CPT called ‘resource’.
I can access the cpt archive by going to http://site.com/?post_type=resource
But when I make my query I lose this parameter… I get a query string that looks like, for example, “http://site.com/?resource_type=magazine-article&topics=&timeline=”
What I want is to have the resource archive automatically add “?post_type=resource” to query strings, resulting in query strings like this: “http://site.com/?post_type=resource&resource_type=magazine-article&topics=&timeline=”
One way to solve this would be to add a dropdown for post types, but for some reason I can’t seem to get this to appear.
Sorry if this is the wrong place for all this… I think I may have to start my own support thread.
I’d love to know this as well.
Forum: Fixing WordPress
In reply to: Post revisions not saving for custom post typesMaybe a bit of clarification can help with finding a solution…
1. Where I define all of my custom post types, in functions.php, I specifically enabled revisions. So when I say that there is “no revisions history at all”, what I mean is that the “Revisions” box that shows up as I edit custom post types does not contain any history of edits made to a post, unless it is a “post” or a “page”. The box shows up but it is always empty. I’ve also tried the “Revision control” plugin and manually inputted all post types which revisions should be enabled for. This doesn’t change much – I get an empty box entitled “Revisions” that doesn’t save any individual edits.
2. We are no longer dealing with WordPress 3.3.2 – I’ve updated the core to 3.4.2 but it has had no effect on this problem. I thought perhaps I had edited a line of code in the core that was causing this trouble, but that doesn’t seem to be the case.
Anyone have any ideas?
Forum: Fixing WordPress
In reply to: Post revisions not saving for custom post typesAnyone? I’m still having trouble with this.
I have basically figured this out… was having trouble with the queries. Will post code for anyone who may be trying something similar once it’s a little bit cleaner!
Forum: Plugins
In reply to: Choosing post types for Wiki Page LinksThe first Porky Pig, the one that turned into a link, was meant to read as:
<a href="http://codex.wordpress.org/Porky_Pig">Porky Pig</a>