Archived topic
Using button code in ad rotator
5 replies · Started by Steve on January 25, 2022
I have question about buttons. I am using an ad rotate plugin to change content on a site. For example different motorcycles. I want to include a button in the add. I cannot get the button to display properly. I think this is related to how GP generates the button class with a unique number. Is there a generic way to create the button?
For example this is the button code generated on the page.
Button 2016 Harley-Davidson <br>Road Glide® Ultra Button
If I use that as part of my ad code the text and link show but not the button appearance.
Hi Steve,
I'm not sure I fully understand your question, and the site you linked is not using GP.
If the issue is related to GB's unique ID, why not use WP's core button block?
Let me know if I miss anything.
Sorry the button is supposed to link to an external site.
Here is one of the pages I am working on.
http://www.strokersmotorcycles.com/
There are two rows. The first is built with qubley. The second is the one I am working with. The second row of images and buttons is built with GP. I would like to be able to add an image and the button below to the ad rotator plugin.
Below the GP row you will see the image and button text as displayed by the add plugin. Here is the code I copied from the page and added to the ad plugin.
<figure class="wp-block-image size-full is-style-default"><a href="https://www.strokersonline.com/Motorcycles-Harley-Davidson-Road-Glide-Ultra-2016-Dallas-TX-8d332ca6-9468-4737-bbce-adb5010b77f3" target="_self"><img src="http://www.strokersmotorcycles.com/wp-content/uploads/2022/01/6000000001_480px3.jpg" alt="" class="wp-image-4892"/></a></figure>
<a class="gb-button gb-button-53197548 gb-button-text" href="https://www.strokersonline.com/Motorcycles-Harley-Davidson-Road-Glide-Ultra-2016-Dallas-TX-8d332ca6-9468-4737-bbce-adb5010b77f3"> 2016 Harley-Davidson <br>Road Glide® Ultra </a>
Does that make more sense?
I see what you mean now.
Try to copy the buttons wrapper as well:
<figure class="wp-block-image size-full is-style-default"><a href="https://www.strokersonline.com/Motorcycles-Harley-Davidson-Road-Glide-Ultra-2016-Dallas-TX-8d332ca6-9468-4737-bbce-adb5010b77f3" target="_self"><img src="http://www.strokersmotorcycles.com/wp-content/uploads/2022/01/6000000001_480px3.jpg" alt="" class="wp-image-4892"/></a></figure>
<div class="gb-button-wrapper gb-button-wrapper-d8954a7a">
<a class="gb-button gb-button-53197548 gb-button-text" href="https://www.strokersonline.com/Motorcycles-Harley-Davidson-Road-Glide-Ultra-2016-Dallas-TX-8d332ca6-9468-4737-bbce-adb5010b77f3"> 2016 Harley-Davidson <br>Road Glide® Ultra </a>
</div>
That seems to work.
Glad to hear that :)