How to create a permalink for custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name

When you create permalink structures like /article/%category%/%postname%/, it becomes very complicated when %category% is hierarchical. The problem WordPress runs into is knowing if after the second slash, the next part of the URL is a category or a post. For instance, in the url /article/parent/child/, is “child” a subcategory of “parent”, or is it a … Read more

Calculate Repeater Meta Box Input Field Values and Display Total

You need to loop through the values of each input and add them together. You can do this using a each. Try this. Replace your calculate function with this. calculate = function(){ var total = 0; $(‘.wpp-repeater-input’).each(function () { total += parseInt($(this).val()); }); document.getElementById(‘wpp_investment_total’).value = parseInt(total); } On a side note: I would remove the … Read more

Remove POST_TYPE from custom post type permalink

As @WebElaine commented on this question I tried the following code which worked for me. First, remove the slug from the permalink function na_remove_slug( $post_link, $post, $leavename ) { if ( ‘services’ != $post->post_type || ‘publish’ != $post->post_status ) { return $post_link; } $post_link = str_replace( “https://wordpress.stackexchange.com/” . $post->post_type . “https://wordpress.stackexchange.com/”, “https://wordpress.stackexchange.com/”, $post_link ); return … Read more

Want to filter only parent post in admin area

In addition to my previous answer add following code. It should work fine add_filter( ‘views_edit-books’, ‘add_filter_link’ ); function add_filter_link( array $views ) { $url = add_query_arg( array(‘bfilter’=>’parents’,’post_parent’=>0,’post_type’=>’books’), ‘edit.php’ ); $views[ ‘post_parent’ ] = sprintf( ‘<a href=”%1$s”%2$s>%3$s</a>’, esc_url( $url ), ( is_filter_active() ) ? ‘ class=”current” aria-current=”page”‘ : ”, ‘Post Parents’ ); return $views; } function … Read more