Git Product home page Git Product logo

Comments (6)

jjgrainger avatar jjgrainger commented on September 27, 2024

@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.

rabinrai44 avatar rabinrai44 commented on September 27, 2024

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.

jjgrainger avatar jjgrainger commented on September 27, 2024

@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.

rabinrai44 avatar rabinrai44 commented on September 27, 2024

@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.

jjgrainger avatar jjgrainger commented on September 27, 2024

@rabinrai44 No problem 👍

from wp-custom-post-type-class.

rabinrai44 avatar rabinrai44 commented on September 27, 2024

👍

from wp-custom-post-type-class.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.