tactics
Forum Replies Created
-
Forum: Plugins
In reply to: [Related Posts by Taxonomy] Plugin inserting " "s before excerpts<?php if ( $related_posts ) : ?> <ul> <?php foreach ( $related_posts as $post ) : setup_postdata( $post ); ?> <li> <?php the_post_thumbnail('thumbnail'); ?> <h4> <?php if ( get_the_title() ) the_title(); else the_ID(); ?> </h4> <?php the_excerpt(); ?> <a href="<?php the_permalink() ?>">Read More</a> </li> <?php endforeach; ?> </ul> <?php else : ?> <p> <?php _e( 'No related posts found', 'related-posts-by-taxonomy' ); ?> </p> <?php endif ?> <?php
Forum: Plugins
In reply to: [Related Posts by Taxonomy] Plugin inserting " "s before excerptsI’m not manually creating an excerpt. These are the excerpts that wordpress automatically generates from the first few words in the post.
Forum: Plugins
In reply to: [Related Posts by Taxonomy] Plugin inserting " "s before excerptsYep. Scroll down to the bottom of the page. The first post has one, the second has four, the last one has none. Completely random…
https://violetweddings.com/wedding-styles/classic-fifth-avenue/
Forum: Plugins
In reply to: [Related Posts by Taxonomy] Plugin inserting " "s before excerptsNote: should be “nbsp” between the quotes above
Forum: Plugins
In reply to: [Custom Post Type UI] Custom post types in more than one category?OK, I finally figured it out. Here it is:
<?php
$args = array(
‘post_type’ => array( ‘wedding-styles’ ),
‘order’ => ‘asc’,
‘orderby’ => ‘title’,
‘posts_per_page’ => -1
);$loop = new WP_Query( $args );?>
<?php while ( $loop->have_posts() ) : $loop->the_post();?>Forum: Fixing WordPress
In reply to: Create archive page of all posts from custom post type category?I finally figured it out:
<?php
$args = array(
‘post_type’ => array( ‘wedding-styles’ ),
‘order’ => ‘asc’,
‘orderby’ => ‘title’,
‘posts_per_page’ => -1
);$loop = new WP_Query( $args );?>
<?php while ( $loop->have_posts() ) : $loop->the_post();?>Forum: Plugins
In reply to: [Custom Post Type UI] Custom post types in more than one category?Anybody? I’ve been trying to figure this out for three days with no luck. There has to be SOME way to display custom posts types in more than one archive page.
Forum: Fixing WordPress
In reply to: Create archive page of all posts from custom post type category?Yes. I already have a custom post type template for my wedding-styles category, and it is successfully displaying the posts from that category. The code I pasted above is in another template called “archive-wedding-stationery.php”. I want it to show the same posts, just in a different format.
Forum: Plugins
In reply to: [Custom Post Type UI] Custom post types in more than one category?Thanks Michael, here’s what I’ve done:
1. I registered a new custom post type called “products” using the CPT UI
2. I created a new archive template called “archive-products.php” and uploaded it
3. I added the following code to that newly created template:if(have_posts()) : ?> <div id="archive-wrap" class="clearfix"> <div id="archive-entries-wrap" class="clearfix"> <div class="grid-loader"><i class="icon-spinner icon-spin"></i></div> <?php $args = array( 'tax_query' => array( array( 'post_type' => 'cars' ) ) ); $postslist = get_posts( $args ); ?> <?php if (have_posts()) { while (have_posts()) { the_post( ); $format = get_post_format(); if ( false === $format ) $format = 'standard'; wpex_hook_entry_before(); ?>
But it’s not working. What am I doing wrong?
Forum: Plugins
In reply to: [Custom Post Type UI] Display custom post type description in template?My goof, you’re right, that works. Thanks Michael.
Forum: Plugins
In reply to: [Custom Post Type UI] Custom post types in more than one category?Thanks, but that’s not quite what I’m after. What I want is two different custom post type archives, that contain the same posts. So let’s say I have a custom post type category of “cars”, and in it I’ve created a corvette post, and a porsche post. I also have a custom post type category called “products”. I want the posts to appear in both category archive pages. Make sense?
Forum: Plugins
In reply to: [Related Posts by Taxonomy] Display thumbnail, title, and excerpt?I ended up just doing the child theme and adding the thumbnail to the excerpt template in that. Works fine. Thanks!
Forum: Plugins
In reply to: [Custom Post Type UI] Display custom post type description in template?Nope, doesn’t work. But thanks.
Forum: Plugins
In reply to: [WP Pinboard] Display only pins from specific board?Thanks Josh.
Forum: Plugins
In reply to: [Beautiful taxonomy filters] Filter only within specific category?Thanks. I found one that does it: https://www.designsandcode.com/wordpress-plugins/search-filter-pro/