Custom Post Type URL doesn’t work anymore
Have you tried to update your Permalink Settings? That might sort it out. Btw. how did you named your CPT?
Have you tried to update your Permalink Settings? That might sort it out. Btw. how did you named your CPT?
You should be able to use a body class to style your menu item : .single-project .menu-item-45 a In “Appearance > Menu”, you could also add custom CSS classes to menu items. You could give your Portfolio menu item a class of “portfolio” and do this : .single-project .menu .portfolio a I do this mainly … Read more
You’re only seeing one post because with each iteration of the loop you’re overwriting the previous iteration’s value of $ea_var on the line $ea_var=”<article id=”post-“;. declare $ea_var outside the while loop and change that line to append with .= One other issue you’ve got is the use of $post->ID won’t work unless you first globalize … Read more
Try updating your permalinks in the backend under Settings -> Permalinks. Be sure to “Save Changes” even if you don’t make any changes. It seems to refresh the permalinks. Also verify the “slug” is set properly when you’re setting up your post type.
This code: $term = get_term_by( ‘slug’, get_query_var($wp_query->query_vars[‘taxonomy’]), $wp_query->query_vars[‘taxonomy’]); … just fetches the term data for the currently queried term, it’s not altering the query in any way. To alter the query for your taxonomy term archives, you want to use the pre_get_posts action. Altering the query in the template just creates a new query, overwriting … Read more
That is because you haven’t close php before anchor tag <?php $args = array( ‘post_type’ => ‘xyz’, ‘posts_per_page’ => -1, ‘orderby’ => ‘rand’ ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); ?> <a href=”https://wordpress.stackexchange.com/questions/66197/<?php the_permalink(); ?>” title=”<?php the_title_attribute(); ?>” > <?php the_post_thumbnail(‘wine-flow’, array(‘class’ => ‘item’)); ?> </a> <?php endwhile; ?>
I’m half asleep here so correct me if I am wrong here but it looks to me like you are saving the publish date of the post each time you save the post, $wr_event_end_date = isset($_POST[‘wr_event_end_date’]) ? $_POST[‘wr_event_end_date’] : ”; $event_end_date = new DateTime($wr_event_end_date); update_post_meta($post->ID, “event_end_date”, $event_end_date->getTimestamp()); This -> $event_end_date->getTimestamp() being the culprit. So regardless … Read more
If what you are trying to do is pre-populate the text input, it looks to me like you need to echo the $zip_code variable you are creating: <input type=”text” name=”zipcode” placeholder=”Zip Code” value=”<?php $zip_code = mo_baptist_get_meta(‘street_zip’); echo $zip_code ?>” /> other than that, I also noticed that the text input was not closed – I … Read more
Your setup is all over the place. Lets refer to the visual overview here: http://codex.wordpress.org/Template_Hierarchy#Visual_Overview Your page is going to use the page.php template. Your custom post type weine will use single-weine.php Your custom taxonomy sorte ( probably not the best name as it might clash ) will use the template taxonomy-sorte.php So we can … Read more
in that Archive page, where you have your pagination (did you create it?) use add_query_arg(‘paged’, (int)get_query_var( ‘paged’ )+1); for the ‘next page’ href. Also, WP Page-Navi is a GREAT and easy way to add pagination to your archive-post_type.php file