shaun — 2014-06-17T14:05:58-04:00 — #1
I have a baffling problem I've never encountered before.
I'm developing a new Wordpress website, doing almost everything I've done a dozen times before on the same server, but somehow I'm getting a 404 error when trying to view Posts. And only posts. Pages work fine. And here's the baffling part, it's different across the browsers! Why should a server configuration error be browser-specific?
It seems I could view my single Posts just fine on Firefox, but on Internet Explorer, Chrome and Android Mobile, I'm getting the 404s.
I have a single.php file made.
I tried uploading the site to a different server. I tried re-saving the Permalinks settings inside of Wordpress. I tried manually deleting and retyping the .htaccess file. I tried copying a working .htaccess file from another website.
I even tried going back to the default Permalinks setting, which, maddeningly, doesn't work either! Somehow the Pages are still working cross-browser just fine (website.com/index.php?page_id=123) but still getting 404s in IE, Chrome, mobile when trying to view Posts (website.com/index.php?p=123)!
argh! I have no idea what to do!
Any further suggestions anyone?
What might the problem be? And why would it be different across browsers?!
shaun — 2014-06-17T14:42:44-04:00 — #2
Wait! I know what's wrong!
For this website I'm using Posts in a different way than I'm used to; Which is all of the Posts represent upcoming events and therefore have future dates.
Therefore, when trying to view a single Post that Wordpress thinks is scheduled (therefore not yet published) while not logged in, it'd return a 404 error. The reason it's been showing on Firefox? I'm logged into Wordpress on Firefox.
So now what I really need to figure out is how to force Wordpress to display those schedules Posts!
shaun — 2014-06-17T14:51:33-04:00 — #3
aha! Here we go. A plugin that changes the status of scheduled posts from 'future' to 'published'.
shaun — 2014-06-17T14:52:34-04:00 — #4
- Thanks for your help, Shaun.
mittineague — 2014-06-17T15:00:14-04:00 — #5
Glad you two got it sorted.
The links for Scheduled posts shouldn't be getting shown until they're Published (except in the ACP), no?
shaun — 2014-06-18T09:07:58-04:00 — #6
It's a website about hiking and to make things more user-friendly for the administrator, I renamed 'Posts' to 'Hikes' and wanted to use the publish date as the date for when the events are carded.
I'd originally found a way to make wp_query display links to the future posts like this:
// Create WP_Query
$args = array(
'category_name' => 'my-category',
'post_status' => 'future',
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => 3
$my_query = new WP_Query($args);
Although I need to throw that out now that I have that plugin installed (linked above).
The 'post_status' on the database for scheduled posts is now no longer 'future', so I'll have to find some way to search records by the date instead.