Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #666105

    Hi there,
    I’d like to add a CTA button to each post by default.
    What should I add to the single.php file and where?

    Thanks you,
    Guy.

    #666219

    Hi guyco!

    Depends on the position you want to add it and what you need to add.
    I am really sorry, but based on your description we can not provide enough details to help you get it shorted.

    Please consider to provide us more details, so we can help you out.

    Thanks a lot

    Regards,
    Basilis

    #666344

    Thanks for the quick reply.
    Making it really general, the button should appear:
    – After the last line of the post text
    – Preferred it to be centered to the page (but I can handle it)
    – It should be a simple button (I’ll handle the rest if needed)
    – It should appear automatically without any dependency on the post content / configuration, and should appear always.

    Simple enough? Please feel free to give only the very basic, I’ll take it from there, thanks!

    #666872

    Hey!

    Try building the CTA content as shortcodes on a blank Page, then copy that and add this at the very end of your theme / child theme functions.php file:

    function add_cta_after_post_content() {
    if (is_singular("post")){
    ?>
    <div class="custom_cta">
    <?php echo do_shortcode("[PASTE SHORTCODES HERE]"); ?></div>
    <?php
    }
    }
    add_action('ava_after_content', 'add_cta_after_post_content');

    Cheers!
    Josue

    #666903

    Thank you Josue!
    Here is the short code I’m pasting, replacing your PASTE SHORTCODES HERE:
    av_button_big label=”CREAT MY TESTIMONIAL WIDGET NOW – IT’S FREE!” link=”https://app.spectoos.com/users/sign_up&#8221; link_target=’_blank’
    Here is the full line of code:
    <?php echo do_shortcode(“[av_button_big label="CREAT MY TESTIMONIAL WIDGET NOW - IT'S FREE!" link="https://app.spectoos.com/users/sign_up" link_target='_blank']“); ?></div>

    I’m getting the following error when saving the file
    Parse error: syntax error, unexpected ‘CREAT’ (T_STRING), expecting ‘,’ or ‘)’ in /home/spectoos/public_html/wp-content/themes/enfold-child/functions.php on line 73

    If I remove the shortcode and leave only () the file saves with no error.

    What am I missing?

    Cheers,
    Guy.

    #666948

    Hi,

    Change all quotes inside the shortcode for simple ones, like:

    <?php echo do_shortcode("[av_button_big label='CREAT MY TESTIMONIAL WIDGET NOW – IT’S FREE!' link='https://app.spectoos.com/users/sign_up' link_target='_blank']”); ?></div>
    

    Best regards,
    Josue

    #666949

    Thank you!
    Please find attached to see how it looks (and what the problem is)

    View post on imgur.com

    Cheers,
    Guy.

    #666967

    Hi,

    Now add this to Quick CSS:

    .custom_cta{ 
      width:100%; 
      clear:both; 
      float:left; 
      margin-top: 80px; 
      margin-bottom: -40px; 
    }

    Best regards,
    Josue

    #666968

    You rock! thanks :)

    #667014

    You are welcome, glad to help :)

    Regards,
    Josue

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.