• reygoch

    (@reygoch)


    I’m using ACF to store some extra data for my posts.

    I don’t want to show all of that data when user visits certain post, e.g.

    mysite.com/{category-name}/{post-name}/

    What would be ideal is to have this kind of url :

    mysite.com/{category-name}/{post-name}/detalis/{field-name}

    And than I would have $details variable with content of field-name url part available in my post template with which I could show or hide some data.

    I’ve tried something like this so far in my functions.php file :

    function add_details_endpoint() {
    	add_rewrite_endpoint('details', EP_PERMALINK);
    }
    
    add_action('init', 'add_details_endpoint');

    but when I visit :

    https://localhost/uncategorized/my-post/details/stuff

    I get 404 error.

    • This topic was modified 8 years ago by reygoch. Reason: fixed function names
Viewing 1 replies (of 1 total)
  • Thread Starter reygoch

    (@reygoch)

    ok, figured it out… i forgot to flush rewrite rules

Viewing 1 replies (of 1 total)
  • The topic ‘Capturing arbitrary semantic URL arguments’ is closed to new replies.