我想通过URL发送post slug并进入其他页面。e、 g,www.example。com/汽车/迷你车我怎么能得到\'mini-car\' 车辆类型
我找到了从url获取id的方法。即:;
$url = get_post_permalink(); //Get the url of the current post
$substring_start_pos = strpos($url, \'pid=\') + 4; //Find the position in $url string where the url number starts
$url_number = substr($url, $substring_start_pos); //Extract the substring form the start position to the end of the url string
$key_1_values = get_post_meta($url_number, \'_song_name\', true );
echo "Your song is called $key_1_values";
我想知道如何处理自定义url(从上一页发送自定义帖子类型的帖子slug),就像我提到的示例一样