Title: PHP dynamic linking
Last modified: August 19, 2016

---

# PHP dynamic linking

 *  [perekl](https://wordpress.org/support/users/perekl/)
 * (@perekl)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/php-dynamic-linking/)
 * Hey everyone – So I’m brand new to WP, but I have a little tiny bit of PHP experience.
   Previously when I would hand code my site, I would use something like “?page=”
   so that I could have the link URL get passed a page name to load the content –
   if that makes sense.
 * What I’m trying to do in WP is use a set of links in my sidebar that will load
   different content depending on which page I am on. I have 5 pages on my top navbar,
   and each one of those has an identical set of “internal” links. I want to point
   the links on the left nav par to something like [http://www.perekl.com/%page-name%/fundraising](http://www.perekl.com/%page-name%/fundraising)
   so that if I am on page 1 and I click fundraising I get taken to the fundraising
   content that belongs with subpage 1.
 * I hope this makes sense, I’m sure there is an easy way to do it that I am missing.
 * I can’t seem to find the right spot in the code to modify this, and the admin
   tool doesn’t seem to have the capability.
 * Any help is greatly appreciated! Thank you!
 * Perek

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/php-dynamic-linking/#post-1729555)
 * Would a plugin like [Page Links To](http://wordpress.org/extend/plugins/page-links-to/)
   work?
 *  Thread Starter [perekl](https://wordpress.org/support/users/perekl/)
 * (@perekl)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/php-dynamic-linking/#post-1729755)
 * I have the plugin but I can’t seem to figure where the code is I need to modify.
   I just need to set the current page (I see in sidebar.php that they have defined
   $current_page) as a built in part of the URL. Anybody know how to do that in 
   WordPress?
 * Thanks!
 * Perek

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP dynamic linking’ is closed to new replies.

## Tags

 * [links](https://wordpress.org/support/topic-tag/links/)
 * [navigation](https://wordpress.org/support/topic-tag/navigation/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [perekl](https://wordpress.org/support/users/perekl/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/php-dynamic-linking/#post-1729755)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
