Is there a way to add a variable to an "a href" to show what blog to point to?

I am working on a multisite using subfolders (not subdirectories) for each site. I have a requirement to make all necessary editing on the front end so the users won't have to go into the admin menus for anything. I am using a template which is used when people create new sites. I am trying to get the theme customize page (wp-admin/customize.php) to show as a button on the front end and am trying to do this using "a href=". My issue is the url on the template page is "http://diplomakids.pleth.net/newchildtest/wp-admin/customize.php?url=http%3A%2F%2Fdiplomakids.pleth.net%2Fnewchildtest%2F" where the "newchildtest" is the name of the template file. I am trying to make this dynamic so that part will be whatever the name of the site is (i.e. if the site name is "testchild" then the url should show "http://diplomakids.pleth.net/newchildtest/wp-admin/customize.php?url=http%3A%2F%2Fdiplomakids.pleth.net%2Ftestchild%2F"). I figure there must be a way to use a variable to do this but not sure how to do it. Any thoughts on how to do this or if there is a better way of doing it rather than "a href"? I tried menus but couldn't find a way to make it dynamic to the specific site so it wouldn't change the template file. Any help on this would be greatly appreciated. Thanks!

  • Dustin
    • Design Lord, Child of Thor

    It is being done on the front end. I am putting the a href in a text widget so it shows up in a sidebar. I wish I could have just done a menu but when I tried it, the link would only link to the template file so any updates on any of the new sites would update the template as well. This is going to be a dynamic path within a theme (I'm using the Genesis framework). I will give your suggestion a try and see how it goes. Thanks!

    Dustin

  • Dustin
    • Design Lord, Child of Thor

    I found a better way to do this. I used the customizer link plugin which added the customizer link to the appearance part of the admin menu. I then looked in the code for the menu and found how it referenced the page. I then just took that code and added it to my widget space with the PHP widget and added this code ("><button>Change Page Appearance</button>). I had to go in to the customize.php page and fix the close button so when it closed, it takes the page back to the original page instead of the themes.php page which wasn't bad. I'm glad I was able to do it this way...it works pretty well. I will go ahead and mark this as resolved. Thank you Jack for your help on this as well. Even though I didn't need to use the code you showed me for this, I will definitely keep it handy for future use.

    Dustin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.