How to add pagination to a post loop in a custom BuddyPress tab

This may not be the proper way but it works in BP profile pages … $paged = ( isset( $_GET[‘vp’] ) ) ? $_GET[‘vp’] : 1; $args = array( ‘post_type’ => array( ‘video’ ), ‘author’ => bp_displayed_user_id(), ‘paged’ => $paged, ‘posts_per_page’ => get_option( ‘posts_per_page’ ) ); $author_videos = new WP_Query( $args ); if ( $author_videos->have_posts() … Read more

get_permalink() of page the enclosing page not posts

I think you need the get_post_type_archive_link function. It requires a post type as a parameter, but since you’re already on the archive page you should be able to use it in combination with get_post_type, which gets the current post type by default: $permalink = get_post_type_archive_link( get_post_type() ); See more on the Codex.

Print post category name from a custom post type wordpress

You shouldn’t use the flush_rewrite_rules function like that read the docs https://codex.wordpress.org/Function_Reference/flush_rewrite_rules#Usage In the param “template” you have an error: <?php the_taxonomies(array(‘template’ => ‘% %l’)); ?> <?php the_taxonomies(array(‘template’ => ‘%s %l’)); ?> If you are using the default value just call the function without any params Edit: I use this code when I want just … Read more

Showing taxonomies with terms that are attached to custom post

Perhaps you can change the label of your taxonomy, as seen on the Function Reference Somewhere in your code, there must be something like register_taxonomy(“bikes”, “post”, [ // … ]); you can change it to register_taxonomy(“bikes”, “post”, [ “label” => “Bicycle” ]); PLEASE NOTE that this part is the definition of the taxonomy itself. Changing … Read more