Hey everyone, just to share something I found out today about custom post types, pagination and 404 not found pages while I was working on my site redesign.
The situationPutting together a showcase gallery to display how people are using my themes.
I created a custom post type for it and was using a page to loop through and display each entry.
The problemUsing the recomended query for custom post types works ok to display the entries but the pagination refuses to display.
Searching a bit got me similar solutions to this: http://themeforest.net/forums/thread/pagination-issue-for-custom-post-type-in-wordpress-30/28915 and this: http://wordpress.org/support/topic/pagination-with-custom-post-type-getting-a-404?replies=1#post-1616810
this solved the pagination issue BUT clicking on the single entry would land me on a 404 not found page!
The solutionAfter further searching I found this: http://wordpress.org/support/topic/pagination-with-custom-post-type-listing?replies=23#post-1637753
that shed some light as to the cause: you CAN ’T have a PAGE and a CUSTOM POST TYPE with the same name.
So making sure that the page slug is different to the custom post type rewrite slug solved the issue so I now have my pagination and my single entries working just fine
Thought I’d share this with you just in case there’s someone else out there “pulling his hair out” on this!
Sorry there was a mistake in my previous code, i forgot to type “global $wp_query;” before this code. Now code is following:
<?php // Get Current Page ID outside Loop global $wp_query; $post_obj = $wp_query?>get_queried_object(); $Page_ID = $post_obj->ID; echo $Page_ID; ?>But unfortunately this code is also not working, no result appear on the screen.
What you should do first is print out the variable to see what you get. so…
<?php print_r($post_obj); ?>
what do you get from that?
$post_obj = $wp_query->get_queried_object();
will give you all sorts of information for the current page.
You can then get the ID from that.
It may also be good to make sure that your post loops don’t conflict so if you are using the loop in your widget make sure your widget defines a new WP_Query
Hope this helps
I am looking for a plugin that can be put onto a widget area. The plugin is pretty simple, all it needs is few fields:
Name: Logo: (They will attach there logo image) Category: Description: Program: Date:
Then when hit submit, it will send all the info including the image to a specific email.
Need this urgently. I also don’t mind if you mod another plugin for this task.Thanks
You should use cformsII for this. They provide a form widget too that you can easily activate wherever you want-as long the area is widget ready
If you a need it to be a WordPress theme, have a look at our eCommerce themes
I’m looking for an e-commerce theme for a photography website and came across this link: http://designm.ag/resources/wordpress-e-commerce/ where I found a link to a theme called ArtShop which says: Another premium theme that is available through ThemeForest for $30. Includes 2 themes, each with a child theme. I think this theme would work for me, but when I went to ThemeForest, I could not find it. Does anyone know where it went to or how I could get it? Thanks, Alisa
Yes, I did remove it as the code was too outdated and was not worth updating anymore. You may find one of my other themes suitable for your needs!
Have a look here: http://themeforest.net/user/srhnbr/portfolio
Mona, I already replied to you email
Please remove the server paths you so openly exposed in your comment. Being a little more security concious is always a wise course to follow!
You may want to Report your comment so that TF support can remove the paths
I need to redirect users to a different page after 12 seconds and I do this with:
<meta content="120; url=http://www.example.com" http-equiv="refresh" />
However I’d like to show them a simple countdown so they know that this is about to happen in 12 (11, 10, 9….1, 0) seconds
Could someone possible assist me a little on this? Or at least point me to the right direction?
Some shameless self-promotion that I don’t normally do but if you take a look at my latest themes (Clothes, Furniture and Jewelry) all offer the type of product personalization you mention aboveTo do this kind of customisation, are you editing the core WP e-Commerce files or doing everything within the theme?
Everything is done within the theme.