Categories
CMS Mastering Development Wordpress

Pagination custom post type not working with rewrite slug

I can’t find the way of making my pagination to work on my post type (this is not on an archive-posttype.php). I’ve rewrited my post type, but the second page isn’t working if I do the rewriting ("medias/actualites"), but it works if I have the non-rewrited slug ("actualite"). I do the rewrite because my client […]

Categories
CMS Mastering Development Wordpress

Custom Taxonomy correctly works on slugs with multiple words, not single term slugs

Here’s the code for my custom taxonomy. function register_taxonomy() { $label = array( ‘name’ => __( ‘Type’, ‘taxonomy general name’ ), ‘menu_name’ => __( ‘Taxonomy’ ) ); $args = array( ‘hierarchical’ => true, ‘labels’ => $label, ‘show_ui’ => true, ‘show_admin_column’ => true, ‘query_var’ => true, ‘has_archive’ => true, ‘rewrite’ => array( ‘slug’ => ‘sections’, ‘with_front’ […]

Categories
CMS Mastering Development Wordpress

$_FILES empty on created_{taxonomy} and create_{taxonomy} yet is is not on edit_{taxonomy}

been struggling with a bug. On created_{taxonomy} hook yet in edited_{taxonomy} hook works and upload the expected file with no issues. As per the following code I added custom field type along with custom taxonomy type. works fine. add_action( ‘init’, ‘addingCustomType’ ); function addingCustomType() { register_post_type( ‘work’, array( ‘labels’ => array( ‘name’ => ‘Works’, ‘singular_name’ […]

Categories
CMS Mastering Development Wordpress

$_FILES empty on created_{taxonomy} and create_{taxonomy} yet is is not on edit_{taxonomy}

Hello, been struggling with a bug driving me insane. So i have custom taxonomy field that would like to add to it it’s own custom filed icon. The following code is basically to add custom post type work. And a custom taxonomy type work_type that is for work post type. Everything is smooth e.g. getting […]

Categories
CMS Mastering Development Wordpress

Custom post type author issues

I’ve created a CPT called ‘artigos’ (articles), which supports title, editor, thumbnail and author. I can see and choose the author of the post, but in the users screen, the number of posts assigned to an author doesn’t change, and the author page can’t find the articles. Am I missing something? function custom_post_type_artigos() { $labels […]

Categories
CMS Mastering Development Wordpress

WordPress Rest API only returns content when posttype has editor capability

I am trying to request my post via the WordPress V2 Rest API in the backend. For whatever reason the post content is only returned when my custom post type has the editor support enabled. Is there a way to get the post content in the same request without having to enable the Gutenberg Editor? […]

Categories
CMS Mastering Development Wordpress

Custom post type permalin return bad url

I have problem with custom post type. In BO url’s are ok example: page.pl/post_type_name/post_title When I try use get_the_permalink(); or the_permalink it return url like: /?post_type=cpt_wydarzenia&p=258" Code: $args = array( "label" => __( "Wydarzenia", "vilo" ), ‘labels’ => $labels, ‘hierarchical’ => false, ‘supports’ => array(‘title’, ‘editor’), //’taxonomies’ => array( ‘category’, ‘post_tag’ ), ‘public’ => true, […]

Categories
CMS Mastering Development Wordpress

Why is my archive page looping through all but one post?

I’ve created an archive page for my custom posts, it loops through every one except the first. There is 11 posts overall and I only get 10 on the archive page. Here is my archive template: <div class="container"> <h2 class="entry-title text-center pt-5">Market Place</h2> <p class="text-center">Filter providers by service and click on the logos shown below […]

Categories
CMS Mastering Development Wordpress

Category permalinks don’t work even after flushing

I have created a custom post type (portfolio) and I’m using the built-in Category taxonomy with it. When I view the category archives page, only regular posts are showing under the category, my custom posts aren’t there at all. The options to select categories are there in the Edit Post page (and Quick Edit), they […]

Categories
CMS Mastering Development Wordpress

How to get rewrited name of cusom taxonomy?

I have registered custom post taxonomy with rewrited name: register_taxonomy(‘behold_gallery-albums-subject’, ‘behold_gallery’,array( ‘hierarchical’ => true, ‘labels’ => $labels, ‘show_ui’ => true, ‘show_admin_column’ => true, ‘rewrite’ => array( ‘slug’ => ‘kategorie-galerii’, ‘with_front’ => true ), ‘update_count_callback’ => ‘_update_post_term_count’, ‘query_var’ => true, )); so name of my custom taxonomy is ‘behold_gallery-albums-subject’ but is rewrited to ‘kategorie-galerii’. If I […]