thhhhh
Forum Replies Created
-
Alright, is it just me, or does the my_qmt_url function not do anything at all? Described here: https://github.com/scribu/wp-query-multiple-taxonomies/wiki/Changing-URLs
Forum: Fixing WordPress
In reply to: Post revisions not saving for custom post typesHi,
Still unsolved and I am considering backing up my entire site and re-installing it to try to get this working.
I did add ‘revisions’ to my supports array.
Not yet. I am consistently able to get the function to change the front of the url I generate, such as adding “people” to “example.com/people/?topics=studios”
What I want to do is to add “/?post_type=people&” to the front of my urls. I’ll let everyone know if there are any developments.
Forum: Plugins
In reply to: [WP-dTree] Only link Child and Grand-Child pages?Um, actually, in what I just typed out the post didn’t collate properly. Here’s what I meant:
Studios:
-Columbia Pictures
-Hanna Barbera Studios
-Paramount Studios
–Fleischer Studios
-Universal Studios
-Walt Disney Studios
–Pixar Animation Studios
-Warner Bros.Forum: Plugins
In reply to: [WP-dTree] Only link Child and Grand-Child pages?Well, in my case I have a taxonomy which sorts a great deal of my site into
-Animation Types
-Animation Series
-Countries
-Research Subjects
-Studios
-TimelineLower level taxonomies might look like
-Studios
– Columbia Pictures
– Hanna Barbera Studios
– Paramount Studios
– Fleischer Studios
– Universal Studios
– Walt Disney Studios
– Pixar Animation Studios
– Warner Bros.In this case, and in others, I don’t want the top-level of the taxonomy, “Studios,” to be navigable. I don’t want people to be able to see all posts that have any studio associated with them because it isn’t a useful query. I would, however, like them to view all posts associated with child and grandchild terms – some posts might only be attached to “paramount studios” and not as a lower level term.
In other areas this is even more important – I have a timeline which breaks up everything into decades (1890s, 1900s, 1910s, etc) and then has lower level taxonomies for years (1890, 1891, 1892, etc). I want people to be able to browse by decade or year but not by the “Timeline” taxonomy itself.
Thanks so much for the reply. If there is a way I can achieve this than that would be preferable – even if I could introduce a class for top-level taxonomies and unlink them through CSS or JS? Otherwise I may just add more taxonomies – so Paramount would have a subtaxonomy of “All Paramount,” 1890s would have a subtaxonomy of “All 1890s”. It would of course be preferable to index from the child terms themselves though.
Anyone?
joshuaiz,
Haven’t figured it out yet but I’m back at it again. Will let you know.
Forum: Fixing WordPress
In reply to: Run PHP function from HTML hyperlinkAmazing!! Works perfectly!!
I was under the impression that a PHP function couldn’t be run straight out of an HTML link without a separate script or AJAX, but I guess I was mistaken! This is much cleaner (and more functional) than what I was attempting!
Thanks so much!
Forum: Fixing WordPress
In reply to: Run PHP function from HTML hyperlinkI’ve put in the new function but I still can’t figure out how to trigger it… will keep plugging away
Forum: Fixing WordPress
In reply to: Run PHP function from HTML hyperlinkkeesiemeijer, thanks for responding! What I am trying to do is to make links in my sidebar which add a post_type argument to the existing query string of an archive page.
I didn’t know about these functions, hence why I was using the other ones. But I will definitely try them out. They look like they might do exactly what I was hoping for.
Forum: Fixing WordPress
In reply to: Run PHP function from HTML hyperlinkHi all,
I’ve rewritten this a bit to see if I can get it to work, following jquery ajax tutorials.
I have moved the PHP function I want to execute to my functions.php file. My sidebar now looks like this:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"> </script> <h2>Show... </h2> <script type="text/javascript"> function showAll() { $.get("addquery.php", { value:"" }); return false; } function showAnimation() { $.get("addquery.php", { value:"animation" }); return false; } function showPeople() { $.get("addquery.php", { value:"people" }); return false; } function showResources() { $.get("addquery.php", { value:"resources" }); return false; } function showStudios() { $.get("addquery.php", { value:"studios" }); return false; } function showWiki() { $.get("addquery.php", { value:"wiki" }); return false; } </script> <a href="#" onclick="showAll();">All</a> <a href="#" onclick="showAnimation();">Animation</a> <a href="#" onclick="showPeople();">People</a> <a href="#" onclick="showStudios();">Studios</a> <a href="#" onclick="showResources();">Resources</a> <a href="#" onclick="showWiki();">Wiki</a><br /><br /> <h2>Browse by topic... </h2> <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(7) ) : else : ?> <?php endif; ?>My “Addquery.php” file which I am using to execute the function looks like this:
<?php $_GET['value'] = $value; add_querystring_var($url, 'post_type', $value); ?>But when I run the functions, nothing happens. I can see in chrome that the browser is trying to access “mysite.com/addquery.php?value=wiki” correctly and that it is receiving an error. The error is “Failed to load resource: the server responded with a status of 500 (Internal Server Error)”
Does anyone have any suggestions for how I might proceed?
Forum: Fixing WordPress
In reply to: Run PHP function from HTML hyperlinkDoes anyone have any experience doing this? I’m willing coding strategy if I can accomplish this another way. I don’t really know AJAX but it seems to me like this piece of code here is doing nothing:
if (isset($_GET['run'])) $linkchoice=$_GET['run']; else $linkchoice='';I’ve tried arranging the code in a number of different ways… currently:
function my_qmt_base_url( $url, $CPTquery ) { if ( is_post_type_archive ()) { $CPTquery = get_post_type( $post->slug ); } $url = '?post_type='.$CPTquery.'&'; return $url; } add_filter( 'qmt_base_url', 'my_qmt_base_url' );The results are the same and I don’t see “?post_type=whatever” in my query string. I’m not sure this is a problem with calling the name of the post type, because I can set up the above code with $url = ‘TEST?post_type=’ and I will get a URL which looks like “example.com/TEST?resource_type=&topics=&timeline=”. If I set $url as a fixed value, like ‘?post_type=resource’, it does not affect the URL at all. The code seems to refuse to relay anything after the question mark before post_type. Any ideas?
Still struggling but after a few hours I think that the code looks closer to what it should:
function my_qmt_base_url() { if (is_post_type_archive()) { $CPTquery = get_post_type( $post->name ); } return add_query_arg( 'post_type', $CPTquery ); } add_filter( 'qmt_base_url', 'my_qmt_base_url' );I’ve started a new thread so not to monopolize this one: http://wordpress.org/support/topic/make-empty-queries-filter-automatically-by-custom-post-type-of-archive?replies=1#post-3453695
Yeah, I’m using version 1.62 of QMT.
I want to query ‘resource’, ‘people’, ‘animation’, ‘studios’ and ‘wiki’, depending on if I’m in the resource, people, animation, studios, or wiki archives, respectively.
Following this (http://wordpress.org/support/topic/plugin-query-multiple-taxonomies-base-url-problem?replies=6#post-3452905) I’ve come up with the following code… though it doesn’t seem to actually affect my queries.
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' );