Comments (6)
@rabinrai44 Hi, I'm not quite sure what you're asking here? Where do you want the member_tags
to be displayed?
from wp-custom-post-type-class.
Okay, I want to display that member_tags to list of member page where each member to be displayed with photo, name, position etc.
I got an only photo, name.
<span class="thumb-info-type"><?php the_tags(what functions suppose to be here?); ?></span>
I don't getting those tags with functions the_tags(); get_the_terms('members_tags'); etc.
And here are my actual code for output it might help you to figure it out.
<ul class="team-list">
<?php
//start loop for post thumb/ members
$the_query = new WP_Query( array('post_type' => 'members', 'post_per_page' => 8, 'order' => 'ASC') ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<?php //the loop
while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<?php
$terms = get_the_terms( $post->ID, 'members_tags' );
if ( $terms && ! is_wp_error( $terms ) ) :
$links = array();
foreach ( $terms as $term )
{
$links[] = $term->name;
}
$links = str_replace(' ', '-', $links);
$tax = join( " ", $links );
else :
$tax = '';
endif;
?>
<!-- Member -->
<li class="col-md-3 col-sm-6">
<div class="team-item thumbnail">
<a class="thumb-info team" href="#" alt="team">
<span class="thumb-info-image">
<?php the_post_thumbnail('custom-thumbnail-size', array('class' => 'img-responsive')); ?>
</span>
<span class="thumb-info-title">
<span class="thumb-info-inner"><?php the_title(); ?></span>
<span class="thumb-info-type"><?php the_tags(); ?></span>
</span>
<span class="thumb-info-action">
<span class="thumb-info-action-left"><em>View</em></span>
<span class="thumb-info-action-right"><em><i class="fa fa-plus"></i> Details</em></span>
</span>
</a>
<span class="thumb-info-caption">
<p><?php the_content(); ?></p>
<span class="thumb-info-social-icons">
<a rel="tooltip" data-placement="bottom" target="_blank" href="http://www.facebook.com" data-original-title="Facebook"><i class="fa fa-facebook"></i><span>Facebook</span></a>
<a rel="tooltip" data-placement="bottom" href="http://www.twitter.com" data-original-title="Twitter"><i class="fa fa-twitter"></i><span>Twitter</span></a>
<a rel="tooltip" data-placement="bottom" href="http://www.linkedin.com" data-original-title="Linkedin"><i class="fa fa-linkedin"></i><span>Linkedin</span></a>
</span>
</span>
</div>
</li>
<?php endwhile; wp_reset_query(); ?>
<?php wp_reset_postdata(); ?>
<?php else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
</ul>
Thank You.
from wp-custom-post-type-class.
@rabinrai44 I see,
The the_tags()
function is for the default WordPress tags for posts.
There is a similar function for custom taxonomies, the_terms()
(See the codex).
So where you have...
<span class="thumb-info-type"><?php the_tags(); ?></span>
if you replace that with the following, you should see a list of the member_tags
.
<span class="thumb-info-type"><?php the_terms(get_the_ID(), 'member_tags'); ?></span>
from wp-custom-post-type-class.
@jjgrainger absolutely I got it. the_terms(get_the_ID(), 'members_tags') got that tags.
Thank you @jjgrainger appreciated.
from wp-custom-post-type-class.
@rabinrai44 No problem 👍
from wp-custom-post-type-class.
👍
from wp-custom-post-type-class.
Related Issues (20)
- Add contributing guide
- Sorting Taxonomies HOT 2
- Add field "type" in composer.json HOT 1
- Setting labels HOT 1
- cut 'post' HOT 5
- How to translate post type name HOT 5
- Add menu_position HOT 4
- Won't register on add_action('init') HOT 1
- Custom taxonomy not registering HOT 2
- Changing the bulk actions
- How do I add field price HOT 2
- Adding post_row_actions
- Category HOT 2
- Adding custom columns removed wordpress edit, quick edit, trash and view links HOT 1
- Has Archive HOT 3
- is it possible to pass show_in_nav_menus? HOT 3
- Unable to sort on menu_order
- Taxonomy generating problem
- time to add taxonomy colums
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-custom-post-type-class.