I think you are looking for get_query_var
$term_slug = get_query_var( 'term' );
$taxonomyName = get_query_var( 'taxonomy' );
$current_term = get_term_by( 'slug', $term_slug, $taxonomyName );
Related Posts:
- How does WordPress generate URL slugs?
- Add menu and submenu in admin with a URL instead of slug?
- Best way of removing emoji support from url / slug only
- Allow UTF-8 characters in the user slug part of URL
- Why ids in urls don’t work but slugs do?
- Easiest way to simulate WordPress’s URL resolution to retrieve post ID, etc?
- pass user id in slug and get user information
- wp_insert_post – How do I prevent incremental numbers on child pages?
- How do I link to a blog not set as the homepage?
- Allow Chinese character on post URL slug
- How to edit URL Slug?
- How can I change a media attachment URL/slug, so that I can use that slug for a page?
- Can anybody provide me with a function to generate slugs?
- Site transferred to new server produces 404s
- Thousands of unwanted URLs/pages with “0” in slug created
- Too many redirects (ERR_TOO_MANY_REDIRECTS) only on one page
- How to remove % character from url
- Can non-latin characters appear in slugs?
- Allow duplicate slugs for pages and posts
- Avoiding the -2 in slugs
- mysterious issue with stop words in urls not working – how can I restore multiple url access?
- How to create URL for Pages/Posts
- Modify WordPress to not replace + (plus) characters from URLs?
- How do you retrieve a post by slug name through REST API?
- How does routing on wordpress work?
- Redirecting to old domain after migration
- Unwanted media library URLs in posts?
- How to remove file versions from the file source links in wp_head?
- Update media file url in wordpress media library
- How to create non-unique sub-category slugs?
- Limiting the number of words or characters in the slug/permalink
- Dynamic URL generates dynamic content
- Pages redirected to attachment post
- permalink for category pages and posts
- WordPress converting ../url to http://../url
- Password protected page Hash url
- Which of WordPress’s .php files need to be directly accessible via HTTP?
- home_url(); showing current page instead of site address
- How do I override the emoji url?
- Site broken after using URL Change in Admin
- Custom Post type permalink structure with custom_post_id
- Setting a url for a page
- Imported thumbnails have incorrect URL
- Adding special characters to slug?
- What is the correct way to convert the absolute path of the executing script to a URL, in WordPress?
- 404 error when passing “cat” parameter to URL
- Is it possible to configure WordPress’s Core Files to accept duplicate Child Categories?
- how to trace a file by the route url
- Is get_permalink also the canonical URL?
- Remove trailing slash from previous_posts_link()
- Moved WP into new folder. How to fix image links in posts?
- How do you make homepage redirect to it’s slashed version?
- Using esc_url_raw with protocols properly
- How to parse a custom url (within WP site) and obtain params passed to that URL
- wordpress copyright dynamic
- Multiple duplicate URL’s
- Dynamic URL and pass the data to an iframe
- DNS – Change WordPress Site Name?
- Unnecessary url
- How to close tab automatically if URL has specific word? [closed]
- Finding URI in Child Theme
- Make custom system url
- WordPress Primary Category Changes After Import, Permalink Issue
- Sanitizing URL in a WordPress plugin
- Make the home page’s slug visible in the browser’s URL bar
- How to display translated content with custom slug?
- How to get a page url segment on wordpress?
- How to create a user ability to save pages with full url?
- index.php shows up in url
- Add more than one query parameter onto wordpress url
- WordPress Website change directory
- How to create a standard WP Page that has the same url as an archive
- Change dynamically URL to SEO friendly via .htaccess?
- Get userdata from url
- How to make url variable?
- Let WordPress to go opening an external URL
- Change default query parameters
- Plugins and how to assign urls to content
- WordPress dynamic subpage for ACF
- From whence %E2%80%8E at the end of post link
- WordPress Address (URL) Reverts back
- problem getting audio url
- How to pass REQUEST_URI to function
- URL displays different page (a loop)?
- wordpress url with format .com/category/sub-category
- URL Forwarding – wordpress links reverting back
- Get gallery url (Nextgen) [closed]
- How to use query string in URL to display content on the wordpress page
- Function to get custom post image URL
- How to echo a dynamic url
- WordPress rewrites my link with custom URL scheme to http(s)
- Show page name after home url
- Display custom data based on URL slug
- How to create multiple urls for a same page contents in wordpress
- how to add param string after website url in wordpress?
- Are the wp entries in these URL’s legitimate?
- url ends in “/embed”
- Get Page URl when changing slug and permalink
- Switch WordPress to non-absolute links? [closed]
- How to hide ids from URL [closed]