nathanadams
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Custom Query: Related Posts by Shared Tag AmountHi keesiemeijer,
I’m trying to use your function that you wrote above (as opposed to the plugin) and I can’t seem to get any results.
I’m trying to use it on the single pages for a custom post type (‘projects’), against a custom taxonomy (‘industry’). (If I could match against a second taxonomy, ‘discipline’, that would be even better, but not necessary).
I’ve tried modifying the tax_query array within the function to
'tax_query' => array( array( 'post_type' => 'projects', 'taxonomy' => 'industry', 'field' => 'id', 'terms' => $tag_ids, 'operator' => 'IN' ) )as well as changing wp_get_post_tags to wp_get_post_terms, but no change makes any difference.
The reason I want to use the function rather than the plugin as I have some very specific formatting I want for the results (as well as referencing some ACF values).
Thanks
Forum: Plugins
In reply to: [Advanced Code Editor] Editor's toolbar buttons not working in WP 3.5I’m getting this too. Worked before, but since the update to 3.5 the toolbar buttons don’t do anything
Forum: Fixing WordPress
In reply to: Add 20yrs to post date, and then queryI’ve read through the WP_Query page, and specifically the Time Parameters section, and I still can’t see anything there to achieve what I want to do.
I can see the posts_where filter examples, but I’m not looking to set the date range of the query. More to add 20 years to the date of the posts with the post_type twentyyearsago, and then process the query with both the posts and twentyyearsago posts together.
Forum: Fixing WordPress
In reply to: Add 20yrs to post date, and then queryHi Esmi,
What I’m looking for isn’t multiple loops, but to do it within the one loop (so that example order I had in the original question would be the order they appear within the one loop).
I already have modified the loop via query_posts to include both posts and the custom post type
<?php query_posts( array( 'post_type' => array( 'post', 'twentyyearsago' ) ) ); ?>
It’s just a matter of ratcheting the date of the twentyyearsago posts up 20 years.Cheers
Forum: Themes and Templates
In reply to: Display only parent category of a custom taxonomyThanks aljuk, that looks like a nice simple way of doing it.
I ended up using a different method which checks for if the the category has a parent or not:
For make:
<?php $make =""; $i = 1; foreach((get_the_terms( $post->ID, 'make' )) as $makecat) {if ($makecat->parent == 0) {$make .= $makecat->name; if($i == 1) break;}} echo $make; ?>For model:
<?php $model =""; $i = 1; foreach((get_the_terms( $post->ID, 'make' )) as $modelcat) {if ($modelcat->parent |= 0) {$model .= $modelcat->name; if($i == 1) break;}} echo $model ?>Forum: Themes and Templates
In reply to: Display only parent category of a custom taxonomyNo one has attempted something like this before, or knows how it could be done? Any help will be appreciated.
What a pain. Oh well, I guess I’ll try to think of some non-conflicting alternative names. Thanks so much for your help.
Yes, I do. I’ve just tried changing the name (and slug) of that page to “brandss” (for the sake of experiment), and that seems to have fixed it.
Is there a way of reusing the name? What I want to have is a root/brands/ page which has an intro about the brands and a list of all of them, and then have root/brands/brandname for each brand, listing their products.
Thanks
Hi keesiemeijer, thanks for the response.
I’ve tried all that you’ve instructed:
— updating the permalink structure again
— rename the htaccess file, so that WP generates a new one
— deactivating all plugins
— switching to the default twenty eleven themeIn all cases, the issue still exists.
With the custom permalink structure, when clicking on the brand it appears to be using the correct url structure (http://www.siteroot.com/brands/brandname/) when showing the 404 page. With the default permalink setting it goes to http://www.siteroot.com/?brand=brandname, which works correctly.
The recreated .htaccess file is:
AddHandler php5-script .php # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPressForum: Fixing WordPress
In reply to: External XML feed into WordPress?Was searching for a way of doing this too, and found this unanswered thread. Does any one know a straight forward way of doing this?
Actually ignore me. It’s because the server was set to PHP4, instead of PHP5 (even though it’s supposed to default to PHP5 when setting up a new site… which is why it hadn’t occurred to me)
Ahhh, ok! It should have occurred to me that the ‘ipod’ would cover both iphone and ipad. I changed it in the wp-cache.php file, and it seems to be doing what I want now.
If I want to use the cached_mobile_groups filter, rather than editing the wp-cache.php file as you say, where would I find that?
Cheers!
Sorry for my ignorance, but how do I use the filters?
I tried to change line 450 from
// mobile_groups = array( 'apple' => array( 'ipod', 'iphone' ), 'nokia' => array( 'nokia5800', 'symbianos' ) );
to
// mobile_groups = array( 'apple' => array( 'ipod', 'iphone' ), 'ipad' => array ( 'ipad ), 'nokia' => array( 'nokia5800', 'symbianos' ) );
but no affect. iPad and iPhone are still accessing the same caches as eachother.Or am I looking in completely the wrong place?
Thanks for your help.