adsense

How to Pass Values Between Pages in WordPress





1. Log into the WordPress dashboard at the wp-admin directory of your website. Navigate to 'Appearance' and click the 'Editor' link to load the 'Edit Themes' screen. Click the link to page.php listed under the 'Templates' heading.
2. Add the following code where you want to output your passed value:
The above code looks for the variable 'myvar' in the page URL. If the variable is present, this code will output its variable onto the page. Click the blue 'Update File' button to save your changes.

3. Navigate to 'Pages' and edit or add a page. Type the text for a link in the editor box. Highlight the link text and click the 'Insert/edit link' button. Click 'Or link to existing content' and select a page from the list.
4. Add '?myvar=Hello' to the end of the URL in the 'URL' field of the 'Insert/edit link' box. Change 'Hello' to the value you want to pass to the linked page. Click the blue 'Update' button to finish creating your link. Update or publish the page to save your work. When you click on the link you created, it will take you to that page, where you will see the value of 'myvar' printed on the screen.

Comments

0 Responses to "How to Pass Values Between Pages in WordPress"

Post a Comment

Popular Posts

About