sarscott
Forum Replies Created
-
Forum: Plugins
In reply to: [W3 Total Cache] Cloudflare not retaining settingsHi,
thanks for pointing that out. I hadn’t. But it also didn’t help :-/
I’ve currently just set my nameservers back and have w3 Total Cache doing the minification as I couldn’t get it to work for some reason.
Forum: Fixing WordPress
In reply to: Flush / Rebuild / Refresh RSS CacheUnknowingly, I had 2 versions of my functions.php file open and the one with my changes wasn’t being saved correctly.
Every time I adjust the XML feed the RSS is rebuilt automatically.
Forum: Fixing WordPress
In reply to: Get current post taxonomy (category)I never seem to get a reply on the WordPress forums…
I managed to solve it by using this code. Maybe it will help someone else:
<?php //Get the posts taxonomy details. $taxonomy = 'car_manufacturers'; $terms = wp_get_object_terms( $post->ID, $taxonomy, array('orderby'=>'term_order') ); //If terms has something in it, echo what I need. // 0 = Manufacture // 1 = Model // 2 = Chassis Prefix if ( !empty( $terms ) && !is_wp_error( $terms ) ) { echo $terms[1]->name; } ?>Forum: Fixing WordPress
In reply to: get_lastpostdate for custom post typeWell, I got an answer over at Stackoverflow. Look like I have to query the post type, get the last post and get it’s modified date. I then wanted to format the date so that it read like “15th May”.
The code is as follows.
<p><?php $latest = new WP_Query(array('post_type' => 'car', 'post_status' => 'publish', 'posts_per_page' => 1, 'orderby' => 'modified', 'order' => 'ASC')); if($latest->have_posts()){ $modified_date = $latest->posts[0]->post_modified; } //Get the last post update and display the date as "10th March" $lastpost = strtotime($modified_date); $lastmonth = date('F', $lastpost); $lastday = date('jS', $lastpost); echo 'Last Updated '.$lastday.' '.$lastmonth; ?> </p>Forum: Fixing WordPress
In reply to: Custom post type – Template page not being foundOk so for anyone reading this…
I changed my custom post type from ‘showroom’ to ‘car’ and made the various adjustments (single template name etc) all is fine!
Only lost about a day of my life 🙂
Forum: Fixing WordPress
In reply to: Custom post type – Template page not being foundUpon further investigation this problem is only happening when I set Permalinks to “Post name”. If I select “Numeric” for example, the template file is displayed.
Does anyone know why that might be?
Forum: Fixing WordPress
In reply to: Custom post type – Template page not being foundPerhaps I’m doing this wrong.
Can someone answer me this…
If I want to create a page to display one custom post type and style how that post type is displayed e.g grid etc.
Do I make a Archive page for that post type and build the structure in there?
OR
A Template file for the Page I created in my admin panel?Thanks
Forum: Fixing WordPress
In reply to: Template file not called using 'Post name' permalinkI can get it to work if I create is archive-showroom.php and copy my template file content into it. But still doesn’t explain the odd behaviour in my last post.
Any ideas?