Attempting to create custom “post” template, getting a 500 internal server error
The first step in this situations is to enable WP_DEBUG to get more info about the error, you can learn more here https://codex.wordpress.org/WP_DEBUG
The first step in this situations is to enable WP_DEBUG to get more info about the error, you can learn more here https://codex.wordpress.org/WP_DEBUG
wp_dropdown_categories() will produce a select element with the default name and id of cat. You can change these by passing different values for id and cat in the $args array. The default value it uses is the term_id. Depending on what you’re expected to use in the get_field() function, you can also change that in … Read more
A quick answer – post-type-switcher plugin below: https://wordpress.org/plugins/post-type-switcher/ Though it would be great without a plugin.
When you’re using get_post_meta() and the post meta doesn’t exist for that post (or page or custom post type), then the function returns either an empty array or empty string depending on if the third parameter is false (default) or true. Since you’re passing true as that parameter, you can check if either the first … Read more
tax_query not working?
Custom Post Type Pagination – not displaying posts
Add new custom post type screen (admin area) results into 404
My solution is for a WordPress Installation (Version 5.2.2), for translation is only WPML Multilingual CMS (Version 4.2.7.1) installed. The modules WPML String Translation (which is very performance-consuming) and WPML Translation Management are not required. I’m using this WPML url structure: www.url.com/en/postname. My Custom Post Type should have the slug “produkte” in German, “products” in … Read more
Aleluhia ! it was because $type don’t use WPML function Here is the code that works perfectly with WPML and translated slug : // .html pour les customs posts function rewrite_rules($rules) { $new_rules = array(); foreach (get_post_types() as $t) $new_rules[$t . ‘/(.+?)\.html$’] = ‘index.php?post_type=” . $t . “&name=$matches[1]’; return $new_rules + $rules; } add_action(‘rewrite_rules_array’, ‘rewrite_rules’); … Read more
How to properly set a value to meta fields of a custom post type in WP-API/node-wpapi REST API?