Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter sarscott

    (@sarscott)

    Hi,

    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.

    Thread Starter sarscott

    (@sarscott)

    Unknowingly, 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.

    Thread Starter sarscott

    (@sarscott)

    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;
    	}
    ?>
    Thread Starter sarscott

    (@sarscott)

    Well, 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>
    Thread Starter sarscott

    (@sarscott)

    Ok 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 🙂

    Thread Starter sarscott

    (@sarscott)

    Upon 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?

    Thread Starter sarscott

    (@sarscott)

    Perhaps 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

    Thread Starter sarscott

    (@sarscott)

    I 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?

Viewing 8 replies - 1 through 8 (of 8 total)