简体   繁体   中英

WordPress Rewrite url to get value in page

How can I get a value on the page? For example,

my page is:

domain.com/mypage/

my value is 'myvalue' in this page Similar below:

domain.com/mypage/myvalue

I want to get the amount of 'myvalue' on 'mypage' page, Please give me a complete code sample

Thank you for your answer

i use this cod:

function foo_rewrite_rule() {
    add_rewrite_rule(
        'currency-analysis/([a-z0-9-]+)[/]?$',
        'index.php?page_id=563&currency-analysis=$matches[1]',
        'top');
}
add_action( 'init', 'foo_rewrite_rule' );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM