Good day to all!
I need to grab article's URL and modify it by deleting the last part of it (moving one level up).
Grabbing the current URL with Wordpress function <?php echo get_permalink( $post->ID ); ?>
Example of use. My current article's URL:
http://example.com/apples/dogs/coffee
Delete the last part of URL so it will be:
http://example.com/apples/dogs
(And with no slash at the end)
So this will return the current Wordpress URL:
<a href="<?php echo get_permalink( $post->ID ); ?>">Text</a>
but how can I delete the last part of it?
Thanks in advance!