I want to get "abc_15_11_02_3" from http://example.com/project_name/abc_15_11_02_3/. How can i do this?
相关问题
- Display product ACF field value in Woocommerce tra
- Adding a custom button after add to cart button in
- How to add a “active” class to a carousel first el
- Setting custom order statuses as valid for payment
- change the font size in tag cloud
相关文章
- wordpress新增页面如何个性化设置
- select query in wordpress
- Get WooCommerce featured products in a WP_Query
- Woocommerce update shipping methods in checkout vi
- Change order status just after payment in WooComme
- Publishing or uploading failed. Error message: “Th
- Facebook Login With WP JWT Auth
- Wordpress development process
You can do this is in many ways like:
1- You can use Wordpress global variable
$post
:2- Or you can get use:
3- Or get full url and then use the PHP function
parse_url
:I hope above methods will help you.
You can retrieve it from the post object like so:
You can get that using the following methods:
Or You can use this easy code:
If you want to get slug of the post from the loop then use:
If you want to get slug of the post outside the loop then use:
use global variable $post
Wordpress: Get post/page slug