CustomPress Plugin: custom post type ordering by date failure

Ugh .. I've found a flaw in either the developers code or the system that by all intents should work but in reality isn't and I can't figure out why. I've got a vendor listing section to the website and I hired a developer to do the code for me .. and from what I can understand it should work.

I'm sure it used to but I've upgraded to the latest version of CustomPress and I'm fuzzy now wether it did or didn't.

$args = 'vendor_categories='.$cat.'&post_type=vendor_paidlisting&orderby=date&order=DESC&posts_per_page=1';
	query_posts( $args );

In the above section of code it should retrieve the latest paid listing that was posted to the category. The problem is .. is that the orderby=date thing isn't working. It's actually pulling up the closest to A within the alphabet.

In this listing http://www.loveinportraits.com/vendor-category/photographers-videographers/ the dummy vendor Sugar High should be the latest vendor listing. However it's showing Cathie Heart Photography as the latest when it isn't, Sugar High is the latest vendor listed .. however Cathie Heart Photography is the closest to A alphabetically.

Now I don't know if this is linked to a back end issue I've spotted about the Date. I created a new custom post type of post and hierarchical.

Please check the screenshots I've included which show that when I view the vendor categories for photographers, it shows all the vendor listings sorted by alphabet .. even when I've asked it to sort by Date!!

Is this back end date sort feature causing the front end display failure?

Why can't I get the latest vendor listing to work?

THIS REQUEST IS URGENT AS MY CLIENT GOES LIVE IN 48 HOURS!

Thanks
Cathie.

  • CathieHeart
    • Site Builder, Child of Zeus

    I've been in touch with the developer who wrote the above code for me and he doesn't know how to fix it and says its most likely a plugin error. Is there a way I can get the previous edition of Custom Press to see if it worked with the previous edition or if I'm imagining it!

    Also here are all the plugins I'm using to create this website .. see the attached image.

    Hunting through my files to see if I still have the previous edition of CustomPress to see if the upgrade caused the problem.

  • CathieHeart
    • Site Builder, Child of Zeus

    Nope its not the plugin update, found an old edition of custom press from the multiple backups I have of the site and its not the update that occurred recently.

    For the life of me I cannot figure out why its not pulling through the latest vendor listed. Same problem with the old custom press plugin Version 1.2.4.1 .

    http://new.loveinportraits.com/vendor-category/photographers-videographers/

    Same problem using the developers original code they supplied that I have backed up.

    vs the edited & added to version I'm using http://www.loveinportraits.com/vendor-category/photographers-videographers/

    note the different subdomains in use new.#### vs http://www.####

    Help!

  • CathieHeart
    • Site Builder, Child of Zeus

    Just seen there was a small update to the plugin to Version 1.3.0.6
    Still getting the same problem of now seeing the latest published 'post' ie. vendor listing for the category .. even when its sorted by date.

    I may have to deliver the site without this feature of 'latest vendor listing' until I can get it working!

  • Arnold
    • El Macho WP

    I don't think you're pulling the templates you think you are pulling between new. and http://www.. Look at the underlined section in the two attached images. The new. reads Most Recent which is what it's looks like it's doing. The www. read A-Z order which is what it's doing. Something in your configuration is calling different pages than what you're assuming.

  • CathieHeart
    • Site Builder, Child of Zeus

    That's because I use the www domain as the identical match to what's now on my clients servers. I've removed the 'most recent post' section because it isn't working and I didn't want that copying over to my clients live site.

    i gave two links before to show there is no difference between custompress Version 1.2.4.1 and the latest released version you have.

    The problem still exists .. just that I commented out the 'most recent post' section to avoid showing a flawed section of the site when I copy it over to the live version.

    Can you still help me?
    Thanks.

  • Arnold
    • El Macho WP

    That's my point. If the www site is the one you're trying to get to show in reverse date order, why is it picking a template for an alphabetic sort? That's coming from the template. Nothing in the plugin has the words (sorted A-Z). Where is that coming from?

  • CathieHeart
    • Site Builder, Child of Zeus

    Okay I've finished with their live site and its done and ready to go live tomorrow.

    The last thing to do and get back into the site and working is the 'latest vendor listing' section which I've added back.

    http://www.loveinportraits.com/vendor-category/photographers-videographers/
    Running custompress version 1.3.0.6
    The latest version.

    and

    http://new.loveinportraits.com/vendor-category/photographers-videographers/
    Running custompress version 1.2.4.1
    The older version - the 'new' subdomain is now a misnomer as its the old edition. I just swapped installed into that directly quickly.

    My Staging Website: There is no difference in results of either, same exact code running on both. The only difference is in the style sheet as its referencing old image locations.

    Clients Website: The only difference between what I have on my staging server and what the client is is that the clients code has the 'latest vendor listing' code commented out to make it inactive.

    You'll see that the 'latest vendor listing' doesn't show the actual latest listing. These are both Sugar Love and Sugar High which both have [Newest Listing] next to their name. These are what should show within the 'latest listing' area .. not what currently does.

    I hope the problem is clearer now.
    Thanks
    Cathie.

  • Arnold
    • El Macho WP

    Looking at your code as it stands nothing changes the sort order. This implies that somewhere there is a filter overriding the orderby parameter.

    Don't have time to review all your code so I added a

    //Sledgehammer removal of any orderby filters because there is one somewhere that interfers here.
    	remove_all_filters('posts_orderby');

    just before this search and now it works.

  • CathieHeart
    • Site Builder, Child of Zeus

    Thank you so much Arnold. This means my clients site is delivered in full and I never would have gotten that line to 'remove all filters'.

    My client is super happy with their website, thanks to you I delivered all 100% of it instead of just 95% of it.

    Cathie.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.