- This topic is empty.
-
AuthorPosts
-
December 22, 2014 at 12:57 pm #191451chas.Participant
This plugin does a nice job of inserting custom content based on URL variables. There is not a functional method of inserting default content when no such variable exists. This is on a self-hosted wordpress installation, version 4.1
December 22, 2014 at 1:08 pm #191452AlenParticipantI’m away from my computer and don’t have access to try this plugin out. But if you could explain what the issue is in greater detail, I can try helping out. Question too vague.
December 23, 2014 at 4:01 am #191479chas.ParticipantSorry for the original brevity… in the plugin you set variables and values. For testing purposes, I’m using this page: http://marineagency.com/testing/
For the variable utm_source and matching value skin_inc, the result correctly displays a trackable phone number for this print advertising campaign.
If someone clicks on an ad with the embedded link http://marineagency.com/testing/?utm_source=skin_inc, the target page displays a phone number associated with this campaign. I’m trying to get a default number to display if no such variable is present in the URL (if they navigate directly to http://marineagency.com/testing/).
December 23, 2014 at 4:10 am #191480Paulie_DMemberYou might want to update your profile to show a different user name as your email address is now out in the wild.
December 23, 2014 at 2:28 pm #191527AlenParticipantHopefully following series of images is helpful
Create Variable ( example.com/?variable=value )
Larger VersionCreate Values and assign them to specified variable
Larger VersionNow test to see if you’re getting the correct values (Using Widgets here)
http://farm8.staticflickr.com/7461/16089550072_b84cc8ec94_b.jpg” />
Larger VersionHere’s written directions. This might help as well if you’re planning on using shortcodes directly in your templates.
Hope that helps.
-Alen
December 23, 2014 at 2:30 pm #191529December 23, 2014 at 5:36 pm #191532December 23, 2014 at 5:38 pm #191533December 23, 2014 at 5:41 pm #191537December 23, 2014 at 6:00 pm #191538AlenParticipantI’m afraid to edit the messed up image tag up there and getting my post banned again. :)
December 23, 2014 at 7:04 pm #191541chas.Participant@Alen, yes I’ve got those parts sorted already.
If navigating to ( example.com/?variable=value ) everything works as expected (the desired text is displayed).
However, navigating to ( example.com/ ) with no variable/value pair results in no text displayed. I need to devise a way to display a default text in case of no variable/value pair.
December 23, 2014 at 7:18 pm #191542AlenParticipantIn your template do:
if ( !isset( $_GET['utm_source'] ) ) { echo 'Some Default Data'; } else { echo do_shortcode('[bg_gcc variable="utm_source"]'); }
Tested and working.
December 23, 2014 at 7:59 pm #191544chas.ParticipantThanks – looks like that was the missing piece. Will test later.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.