duplicating page templates

When you duplicated the template, I assume that you gave the template file a new file name, and placed it in the same directory as the source. And that you changed the “Template Name” in the duplicated file. And then made changes to the new template file to change the code on the button to …

Read more

how to create a page that shows all of multiple category posts on a single page

I was seeing nothing in between the header&footer because I did not actually display the posts in my custom query, which can be done using template tags like the_title() and the_content(). More details here: https://developer.wordpress.org/themes/basics/the-loop/ But then I found out that I could simply use the cat parameter in the URL to view posts in …

Read more

WordPress Page Slug with URL custom template

Eventually I found out a solution. Below is how I have achieved this. In my functions.php file, I have put below code. add_filter(‘query_vars’, ‘add_user_var’, 0, 1); function add_user_var($vars){ $vars[] = ‘user’; return $vars; } add_rewrite_rule(‘^user/([^/]+)/?$’,’index.php?pagename=user&user=$matches[1]’,’top’); This generally adds a rewrite rule if it finds user in the URL. Now I have added a page template …

Read more