How To Create Dynamic Routes In WordPress

Поділитися
Вставка
  • Опубліковано 13 кві 2021
  • In this video, we go over how to creat a dynamic route in WordPress
    Code: github.com/alexander-young/wp...
    My favorite caching plugin - WPRocket: wpcasts.tv/go/wprocket
    💖 Become a Patron to show support & get perks!
    / wpcasts
    Sign up for the newsletter. Free course coming soon:
    wpcasts.tv
    *SOCIAL*
    Twitter: / alexanderbyoung
    Facebook: / wpcasts.tv
  • Наука та технологія

КОМЕНТАРІ • 69

  • @WPCasts
    @WPCasts  3 роки тому +6

    Hope you learned something! Make sure to follow me on Twitter: twitter.com/AlexanderBYoung

  • @StevanGeorge
    @StevanGeorge 3 роки тому +8

    Seriously, this is not a regular tutorial, this is really advanced and super informative. I've think about this awhile ago, but couldn't find the tutorial elsewhere. Big thanks Alex.

    • @WPCasts
      @WPCasts  3 роки тому

      Glad it was helpful!

    • @Gyana.Ranjan
      @Gyana.Ranjan 8 місяців тому

      @@WPCasts this is really informative . Looking for this information for months tried chatGPT, claude, bard and finally you gave the solution.
      Thank you For the Video

  • @Daniel667
    @Daniel667 3 роки тому +2

    Thanks for covering this! I will definitely make use of it.

  • @chaz6399
    @chaz6399 11 місяців тому +1

    Thank you. Super helpful video.
    I got a simple example working in no time and now I'm moving on to my desired implementation, which is to create a downloadable ICS file.
    My first ICS implementation generated the ICS file on the client using JS. Shortly after that I added creation of an equivalent ICS file on the server to be sent as an attachment to an alert email.
    I didn't like having two different implementations for the same ICS file, so I'm deprecating the client side generation and replacing it with a hyperlink to a dynamic route that generates the ICS file using the same code as the email alert. Sweet!
    I didn't expect this to be so clean. Thanks again!

  • @markshergold5295
    @markshergold5295 2 роки тому

    You are a legend sir. This has been bugging me all day and not one person could solve the problem. This video has been legendary.

  • @hermanchan6260
    @hermanchan6260 10 місяців тому

    This is exactly what I was looking for, thank you Alex.

  • @jaied
    @jaied 2 роки тому

    Well explained and made the complex topic easy and clear for beginners like me. Thanks for the video. Hope will get more WordPress tutorials from you. 😄

  • @bsevo
    @bsevo Рік тому

    This was super useful! And you explained it in a simple, easy understandable way! :)

  • @cbee402
    @cbee402 2 роки тому

    Gob and Tobias? i wonder if anyone else caught the A.D reference 😄😄 great work btw

  • @tamarayee
    @tamarayee 2 роки тому

    Thanks so much! This is exactly what I needed!

  • @AbdiasVrech
    @AbdiasVrech 2 роки тому

    You rock man! super easy to understand

  • @erichepperlewp
    @erichepperlewp 7 місяців тому

    Mind blown. Definitely advanced, but I love that you covered mistakes that one might make along the way.

  • @barbaral.7326
    @barbaral.7326 3 роки тому

    Thank you so much for that video, its really helpful!!

  • @megameketref
    @megameketref 2 роки тому

    Thanks, this video was very helpful !

  • @rayediaz
    @rayediaz 3 роки тому

    This is AWESOME!

  • @paur.1469
    @paur.1469 Рік тому

    Thanks you so much for such an amazing video!

  • @ahmad-ali14
    @ahmad-ali14 2 роки тому

    That's very helpful, thanks

  • @codingzen869
    @codingzen869 6 місяців тому

    Oh man! Why did you stop making these videos?!! I know this truck but still you make things do easy. Are you alright? It's a gem of a channel. Make more stuff if you are still there. I hope things are ok on your end.

  • @tamtranminh9968
    @tamtranminh9968 8 місяців тому

    Thanks so much my friend

  • @clareivers
    @clareivers 3 роки тому

    Thanks so much, this is awesome

  • @Sonadob
    @Sonadob 2 роки тому

    Thanks 🙏 this was a really good explanation of rewrite rules and query_vars.
    Perhaps you could do a follow-up with more deeper stuff about rewrite rules (with Costum Post Types and taxonomys used with the rewrite rules) and query_vars VS WP_Query.

  • @tecs77
    @tecs77 Рік тому

    Big big thanks 🍎

  • @hadesunseen6388
    @hadesunseen6388 Місяць тому

    thank you for sharing

  • @alexlytle089
    @alexlytle089 2 роки тому

    Thank you

  • @beracode9394
    @beracode9394 3 роки тому

    Good content man. keep it up

    • @WPCasts
      @WPCasts  3 роки тому +1

      Thanks, will do!

  • @tejindersingh7935
    @tejindersingh7935 2 роки тому

    I was trying to find out similar tutorial on the internet but could not find that but got your youtube video link. That's amazing. Really helpful.
    What is the difference if we have a page available with the rewrite structure?
    For example: characters ( page )
    How to do rewriting on the above page with custom query variables?

  • @everybot-it
    @everybot-it 2 роки тому

    I think you saved my project with this tutorial. I'll update you once I got the thing together.
    .... I'm still stuck trying to create MULTIPLE custom routes. I can't seem to wrap my head around the syntax in the functions.php yet

  • @030426101993
    @030426101993 2 роки тому

    awesome

  • @marcitrixie
    @marcitrixie 3 роки тому +1

    nice video. but can i edit permalink structure on edit page or post type?

  • @fwdflashwebdesign
    @fwdflashwebdesign 3 роки тому

    Good video

  • @sina-qh8wm
    @sina-qh8wm 3 роки тому

    perfect ;)

  • @m_andrasch
    @m_andrasch 2 роки тому

    Great video, thanks so much!!! 👏👏👏 Has anybody by chance a tutorial on how to combine this with breadcrumbs? I also needed to override the wordpress page title since WordPress somehow always used the startpage title.

  • @nicolasortiz2416
    @nicolasortiz2416 Рік тому

    GOAT

  • @elabinnovations
    @elabinnovations 2 роки тому

    Thanks
    I want set custom content-type also. How is that possible
    i.e, When a user visits /svg/:MyName
    Then it return a dynamic svg image containing MyName data with content-type:image/svg+xml

  • @khairulalam9708
    @khairulalam9708 3 роки тому +3

    Hey Alex, would you do a tutorial on custom post types data filtering using AJAX, by custom taxonomies of that post type. A real life scenario would be something like a hotel booking application, where you have multiple dropdown to select (probably different options of that post type i.e. location, price, no. of beds etc) and then filter and display the results on the same page.

  • @InstaSound
    @InstaSound 2 роки тому

    get_query_var is always "" for me within the add_action block. It only contains the data when within the actual page template, so the logic doesn't work.

  • @theman7050
    @theman7050 2 роки тому

    Is this Tobias Funke based on a real person you know? I've seen youc se his name in another video as well :P
    By the way, the video content is AGAIN over the top, man. 👍🏼✌🏼
    Thank you very much.

  • @PaymanShamlu
    @PaymanShamlu Рік тому

    Thnx for you great content
    I have two questions regarding the video:
    1- what is the use of add rewrite tag?
    You didn't use it here. I just can't understand when is neseccary to employ the rewrite tag function
    2- is this querying safe and secure? No further need for any sanitization?

  •  2 роки тому

    What is the debug bar tool you are using ?

  • @globdug8132
    @globdug8132 3 роки тому

    I really would like to understand the down thumb.... By the way... thank you another great video! 🍻

  • @DeadWavesStudio
    @DeadWavesStudio 2 роки тому

    Could someone explain how to do an api query and pass values to the themes default post template? Like title and content.

  • @MultiPitshou
    @MultiPitshou Рік тому

    Thanks for the Tuts. I tried to rewrite and it worked but my problem is with the flushing of rewrite rules. I tried doing on plugin activation but it doesn't work. Any idea on how to go about?

  • @joeyfest
    @joeyfest 3 роки тому

    The worlds first analyst/therapist

  • @yeltsinreyes672
    @yeltsinreyes672 3 роки тому +1

    And if I don't want to get_header() or get_footer() I can do an include() and then die()?

  • @jdzreacts836
    @jdzreacts836 10 місяців тому

    Hello, thanks for this. This video is very helpful to me, but is there a way to record that 'route' to analytics like jetpack, koko, etc? It only records the page but not the specific character. I would like to see which characters are popular and not.

  • @juliansruiz
    @juliansruiz 2 роки тому

    I love the video and the explanations. I keep getting a 404 error when I visit a link. Swapping out "characters" for "jobs" for a Careers page, and even echoing out "Im the job page" doesn't display with your code copied/pasted. I noticed there isn't an index.php file in this child theme so I swapped category.php for index.php in your add_rewrite_rule function; and also tried creating an index.php file while utilizing the code you have, but it still sent a 404 page. Any possible clue as to why I might not be connecting the page properly?

  • @emmanuelmnzava8966
    @emmanuelmnzava8966 3 роки тому +1

    Awesome video/tutorial i have wanted to know how to create custom links for a while. Is it possible to flush out the permalinks programically ??

  • @tarunpatnayak9161
    @tarunpatnayak9161 3 місяці тому

    How to create single and archive templates from data in custom db tables in wordpress??

  • @theman7050
    @theman7050 2 роки тому +1

    Isnt 'template_include' supposed to be a filter and not an action?

  • @erichepperlewp
    @erichepperlewp 7 місяців тому

    10:15 - Create *character.php* file

  • @Joel-re1jz
    @Joel-re1jz Рік тому

    Is there a way to restrict those routes to certain roles?

  • @okuz456
    @okuz456 Рік тому

    Hey! It works great with the child pages, like "/characters/*name*". However any ideas how to make the parent page work "/characters"? Anyway thanks for the tutorial!

  • @PossessWithin
    @PossessWithin 3 роки тому

    Do you have any full paid courses? I'm primarily a Javascript developer just getting into WP now, I'd like to learn from you.

  • @kokngonose
    @kokngonose 4 місяці тому

    thank you for the video, i want ask to its not related to wordpress but , i saw in your video in 15:12 you say thank you and the like button glow up, is there new youtube feature?

  • @generer
    @generer 2 роки тому

    would WP rocket cache that code?

  • @kevintanudjaja8893
    @kevintanudjaja8893 2 роки тому

    can you pass the api response to elementor, so that we don't have to echo it manually? I mean can we use page builder to use data from api response?

    • @DeadWavesStudio
      @DeadWavesStudio 2 роки тому

      elementor supports dynamic content out of the box

  • @tochukwuokafor1251
    @tochukwuokafor1251 Рік тому

    Thanks for the insight. Please how can I apply it to create an invitation link for users to activate their accounts after the admin has created an account for them? I need answers everybody 🙏🙏🙏🙏🙏

  • @hermanchan6260
    @hermanchan6260 9 місяців тому

    Hi all, I followed what Alex did and was able to implement it. But now my question is how do you implement multiple rewrite rules? In this example, you allow dynamic path ".../character/..." to redirect users to character.php, what if you also want to simultaneously allow dynamic path "..../character2/..." to redirect users to character2.php? How do you differentiate in the template_include action?

  • @fatenfayzo9730
    @fatenfayzo9730 2 роки тому

    Hello, nice tutorial.
    How to use it with plugin

  • @i--vik1007
    @i--vik1007 3 роки тому

    How can I learn wordpress development fast? Kindly list it out.

  • @laxmiprasanna4092
    @laxmiprasanna4092 3 роки тому

    Please make a complete wordpress course on udemy or youtube. There is not many tutorials about that. Most of them are using page builders. People are forgetting to code with wordpress. That is not good.