How to retrieve custom post type permalink in another cpt?

I have solved it by myself: I used following codes instead of <a href=”https://wordpress.stackexchange.com/questions/244525/<?php echo get_permalink(“football_player’ ); ?>”><i class=”fa fa-arrow-right” aria-hidden=”true”></i></a> I used this code: <a href=”https://wordpress.stackexchange.com/questions/244525/<?php echo get_permalink( $home_starting_player ); ?>”><i class=”fa fa-arrow-right” aria-hidden=”true”></i></a>

WordPress Contents Migration

If your data diverged at one site (old site receiving new content) and your code diverged on another (staging site in development) then you don’t really have a conflict here. You can just update live site with new code, assuming things are reasonably compatible. In general WP is not friendly to bi–directional move of content. … Read more

Only show current category post

Use the function get_the_category(); inside the WordPress loop and pass the get_the_ID() function which will get the current post ID in the loop. get_the_ID() will return the post id and whereas the the_id(); will just display. if( $the_query->have_posts() ) : while( $the_query->have_posts() ) : $the_query->the_post(); $category_array = get_the_category( get_the_ID() ); print_r( $category_array ); endwhile; endif; … Read more

Pagination functions won’t work

Don’t create a new query. You can use pre_get_posts for this type of works. Example : If you want to add books and movies custom post type to home page main loop, function books_movies_cpt_in_home($query) { if ($query->is_home() && $query->is_main_query()) { $query->set(‘post_type’, array(‘books’,’movies’)); } } add_action(‘pre_get_posts’, ‘books_movies_cpt_in_home’);