Alicia St Rose
asked on
All of a sudden custom post types returning a 404.
I've created a custom post type called Participant. There is a taxonomy called Offering applied to the Participant. A Participant can fall into one or more Offerings. I'm using a Page with a template to display the different taxonomy archives. So essentially, not using the archive functionality for Offering. I'm using a loop with a link to Single Particpant page:
This is working fine on my local machine, but on the remote server it's stopped working. I'm now getting a 404 when I click on any particpant. And even when I click to view the post type from Admin, I'm getting a 404.
http://2015.lucidityfestival.com/workshop-presentation/
I'm totally stumped on this one!
<?php
$terms = get_terms('artist');
echo '<ul class="archive-terms">';
echo '<li class="current"><a href="' . get_page_link('2603') . '">All</a></li>';
foreach ($terms as $term) {
echo '<li><a href="'.get_term_link($term->slug, 'artist').'">'.$term->name.'</a></li>';
}
echo '</ul>';
?>
<ul class="participant-archive artist-archive">
<?php $args = array( 'post_type' => 'participant', 'offering' => 'artist', 'post_status' => 'publish', 'posts_per_page' => 200, 'cache_results' => false );
$loop = new WP_Query( $args ); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<a href="<?php bloginfo('url') ?>/participant/artist/<?php echo lucidity_the_slug(); ?>"><?php $attachment_id = get_field('photo');
$size = "custom-archive"; // (thumbnail, medium, large, full or custom size) ?>
<?php echo wp_get_attachment_image( $attachment_id, $size ); ?></a><br />
<?php if(get_field('long_name') !=false) : ?>
<h3 class="long-name"><a href="<?php bloginfo('url') ?>/participant/artist/<?php echo lucidity_the_slug(); ?>"><?php the_field('long_name'); ?></a></h3>
<?php else : ?>
<h3><a href="<?php bloginfo('url') ?>/participant/artist/<?php echo lucidity_the_slug(); ?>"><?php the_title(); ?></a></h3>
<?php endif; ?>
</li>
<?php endwhile; ?>
</ul>
This is working fine on my local machine, but on the remote server it's stopped working. I'm now getting a 404 when I click on any particpant. And even when I click to view the post type from Admin, I'm getting a 404.
http://2015.lucidityfestival.com/workshop-presentation/
I'm totally stumped on this one!
Try disabling permalinks (set it back to default), save it, then set permalinks back the way you had it.
ASKER
@Jason C. Levine
Tried this and it didn't work. :(
@David Johnson, MVP
I'm confused by your response. Is there something wrong with the 301? We are redirecting the site from lucidityfestival.com.
Tried this and it didn't work. :(
@David Johnson, MVP
I'm confused by your response. Is there something wrong with the 301? We are redirecting the site from lucidityfestival.com.
Okay, so I'm a little confused by how you've structured this.
The code above has:
<a href="<?php bloginfo('url') ?>/participant/artist/<?ph p echo lucidity_the_slug(); ?>">
But links at http://2015.lucidityfestival.com/workshop-presentation/ all take the form of:
http://2015.lucidityfestival.com/participant/workshop-presentation/jamie-janover
which gives a 404. Going to:
http://2015.lucidityfestival.com/participant/artist/jamie-janover
also does a rewrite, then a 404 (which I think is what David is referring to) and
http://2015.lucidityfestival.com/participant/artist/
Just does a straight 404.
1) Where is /artist/ coming from in the code above and where does it replicate on the sample page?
2) What redirects are in place?
The code above has:
<a href="<?php bloginfo('url') ?>/participant/artist/<?ph
But links at http://2015.lucidityfestival.com/workshop-presentation/ all take the form of:
http://2015.lucidityfestival.com/participant/workshop-presentation/jamie-janover
which gives a 404. Going to:
http://2015.lucidityfestival.com/participant/artist/jamie-janover
also does a rewrite, then a 404 (which I think is what David is referring to) and
http://2015.lucidityfestival.com/participant/artist/
Just does a straight 404.
1) Where is /artist/ coming from in the code above and where does it replicate on the sample page?
2) What redirects are in place?
ASKER
@Jason C Levine
So sorry, I grabbed code from another template!
Here's the correct code that should take care of question #1:
I've got pages for each archive and a specific template is loaded for each one.
2. The redirect is happening on the lucidityfestival.com site. I'm using the Redirection plugin. I had to redirect the archive pages to the new site because old archives where showing up in the search results.
So sorry, I grabbed code from another template!
Here's the correct code that should take care of question #1:
<?php
$terms = get_terms('wisdom');
echo '<ul class="archive-terms">';
echo '<li class="current"><a href="' . get_page_link('2598') . '">All</a></li>';
foreach ($terms as $term) {
echo '<li><a href="'.get_term_link($term->slug, 'wisdom').'">'.$term->name.'</a></li>';
}
echo '</ul>';
?>
<ul class="participant-archive wisdom-keeper-archive">
<?php $args = array( 'post_type' => 'participant', 'offering' => 'workshop & presentation', 'post_status' => 'publish', 'posts_per_page' => 200, 'cache_results' => false );
$loop = new WP_Query( $args ); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<a href="<?php bloginfo('url') ?>/participant/workshop-presentation/<?php echo lucidity_the_slug(); ?>"><?php $attachment_id = get_field('photo');
$size = "custom-archive"; // (thumbnail, medium, large, full or custom size) ?>
<?php echo wp_get_attachment_image( $attachment_id, $size ); ?></a>
<?php if(get_field('long_name') !=false) : ?>
<h3 class="long-name"><a href="<?php bloginfo('url') ?>/participant/workshop-presentation/<?php echo lucidity_the_slug(); ?>"><?php the_field('long_name'); ?></a></h3>
<?php else : ?>
<h3><a href="<?php bloginfo('url') ?>/participant/workshop-presentation/<?php echo lucidity_the_slug(); ?>"><?php the_title(); ?></a></h3>
<?php endif; ?>
</li>
<?php endwhile; ?>
</ul>
I've got pages for each archive and a specific template is loaded for each one.
2. The redirect is happening on the lucidityfestival.com site. I'm using the Redirection plugin. I had to redirect the archive pages to the new site because old archives where showing up in the search results.
ASKER
Anyone?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ah-ha. No wonder we couldn't figure it out. Everything posted looked correct...
ASKER
I found out the issue was caused by an installed plugin.
http://2015.lucidityfestival.com/participant/workshop-presentation/brandi-m-veil
followed by the 404 custom error page