• Hi guys. I want to create a link in all the articles with the following structure:
    https://site.com/link/<?php the_title(); ?>

    What can i do to point all the generated links to the same page? I have a dynamic page that is updating with some information but the link is the same: https://site.com/static-page

    Is there any possibility to send all the links to the same dynamic page? Thanks.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    This already happens by default, all single page requests go to the template file content-single.php. You also cannot use the_title() as a permalink element because titles can contain illegal characters. You should use the post’s name slug as a permalink element.

    If you don’t want to use the built in single page functionality, you could use the Rewrite API to capture any requests containing “/link” and route them to your dynamic page, passing the name slug that occurs after “/link/” as an URL parameter. Your dynamic page then can use this parameter in making it’s query to retrieve the data to be displayed.

Viewing 1 replies (of 1 total)
  • The topic ‘Dynamic links pointing to the same page’ is closed to new replies.