- This topic has 8 replies, 3 voices, and was last updated 7 months, 1 week ago by
David.
-
AuthorPosts
-
July 26, 2020 at 1:22 pm #1377223
Jon
Hi, I’m not using an the Element, but trying to use the copyright bar (enabled in GP Premium Settings). And I’d like to display my affiliate links for GP and Flywheel (my host) using this format:
© 2020 MATCHLESS WEB STUDIO, LLC | POWERED BY GeneratePress + Flywheel
But when using the short codes I registered, likely incorrectly (see PHP below), the output is this:
© 2020 MATCHLESS WEB STUDIO, LLC | POWERED BY +
Where the only link output is the GP affiliate Link and it’s assigned to the “+” that should be in between the two links.
Is there something that could be cleaned up with the PHP below that would correct my error?
Or would it be better for me to scrap the copyright bar and use an Element to produce the effect I’m looking for?
My site is https://matchlessweb.com/ if you’d like to have a look at the copyright bar with this output:
function gp_affiliate_link() {
return ‘‘;
}add_shortcode(“GP”, ‘gp_affiliate_link’);
function flywheel_affiliate_link() {
return ‘‘;
}add_shortcode(“Flywheel”, ‘flywheel_affiliate_link’);
July 26, 2020 at 9:11 pm #1377427Leo
StaffCustomer SupportHi there,
Not sure if I fully understand.
Is there anything special about that link that requires a shortcode?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/July 26, 2020 at 10:16 pm #1377469Jon
I don’t know that there’s anything special about the link, haha. I’m only trying the shortcode route because it says shortcodes are supported. I was assuming I’d need to enter a short code for a link to display there as there doesn’t appear to be WSYIWYG controls for styling things or inserting a link.
If that section does in fact accept links in this format:
a href=”https://matchlessweb.com/generate-press”<GeneratePress
I could just use that instead. I don’t think I even tried dropping the links in that way.
Note:
Looking at my initial post, it looks like I didn’t get my copy/paste right, (oops). This is what is currently entered in my functions.php for making shortcodes out of the two links:
function gp_affiliate_link() {
return ‘‘;
}add_shortcode(“GP”, ‘gp_affiliate_link’);
function flywheel_affiliate_link() {
return ‘‘;
}add_shortcode(“Flywheel”, ‘flywheel_affiliate_link’);
July 27, 2020 at 5:41 am #1377816David
StaffCustomer SupportHi there,
can you test that the Flywheel shortcode works in the post content ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/July 29, 2020 at 3:59 am #1380310Jon
I’ve just added each shortcode into its own paragraph block as well as the shortcode block to see if there was any different behavior between the two. See this page where I’m testing some things: https://matchlessweb.com/search starting at the orange background with the text “ATTN: GeneratePress Support – Shortcode tests in content below”
As you can see, the shortcodes don’t return the desired links.
What’s odd to me is the same shortcodes are what I’ve added to the copyright bar.
But the only link that’s added is the GP link. The only problem with that is it’s being applied to the plus sign “+” between the targeted words “GeneratePress” + “Flywheel” instead of showing GeneratePress + Flywheel with their respective links on the text.
For reference, my copyright bar has the following content:
%copy% %current_year% Matchless Web Studio, LLC | Powered by [GP] + [Flywheel]
July 29, 2020 at 4:17 am #1380337Jon
I’ve now replaced that copyright content with HTML to get the desired result. I may have just been going the long way around by trying to use shortcodes.
But in light of the fact that the copyright area in the customizer says shortcodes are supported, I wanted to try it out.
So I either failed to properly create/register my shortcodes or something funky is going on with the copyright area. If I add just a single one of those shortcodes to the copyright area, it just displays the text with square brackets.
But as I found earlier, having the two shortcodes with a “+” in between assigned the GP affiliate link to the “+” and the Flywheel link wasn’t attached to anything.
Maybe for this method to work I’m supposed to anchor each shortcode to the desired text somehow instead of trying to include the target link text in the HTML of the link that’s inside the shortcodes that I registered in my child theme functions.php? Haven’t experimented with that yet as I’m content to just use the HTML to get the desired effect you’ll see in the copyright bar now on this testing page for example: matchlessweb.com/search
July 29, 2020 at 5:18 am #1380380David
StaffCustomer SupportIt sounds like an issue with the Shortcodes themselves. But it looks like you found a working solution !
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/July 29, 2020 at 2:44 pm #1381137Jon
Yeah it wouldn’t surprise me if I fudged something up trying to create those shortcodes. The HTML links work just fine, so I’m sticking with that. Thanks for the support guys!
July 29, 2020 at 3:49 pm #1381171David
StaffCustomer SupportYou’re welcome
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.