List categories, subcategories and posts from custom taxonomy and custom post type

You just need to tweak the logic so that if ( have_posts() ) : is only run if get_term_children() is empty, which it will be on the lowest level: $term = get_queried_object(); $term_id = $term->term_id; $taxonomy_name = $term->taxonomy; $termchildren = get_term_children( $term_id, $taxonomy_name ); if ( ! empty( $termchildren ) ) { echo ‘<ul>’; foreach … Read more

Remove default WYSIWYG editor without removing custom fields editors

WordPress has the remove_post_type_support function that can be used with this purpouse, you can learn more from https://developer.wordpress.org/reference/functions/remove_post_type_support/ Just an example borrowed from codex /** * Remove excerpt support from posts. */ function wprocs_custom_init() { remove_post_type_support( ‘post’, ‘excerpt’ ); } add_action( ‘init’, ‘wpdocs_custom_init’ );

Custom Field not saving in WordPress

The post meta form is limited to displaying 30 keys by default. To change the value, use the postmeta_form_limit filter: add_filter( ‘postmeta_form_limit’, function( $limit ) { return 50; } ); Also consider adding a custom meta box, where you can set up dedicated fields instead of having to select a key each time.

custom permalink for post only not custom post types

ok so after searching again i found this and it worked /** * Add new rewrite rule */ function create_new_url_querystring() { add_rewrite_rule( ‘recipes/([^/]*)$’, ‘index.php?name=$matches[1]’, ‘top’ ); add_rewrite_tag(‘%recipes%’,'([^/]*)’); } add_action(‘init’, ‘create_new_url_querystring’, 999 ); /** * Modify post link * This will print /recipes/post-name instead of /post-name */ function append_query_string( $url, $post, $leavename ) { if ( … Read more