Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1151387
    flittrst
    Participant

    Hey there,

    I’m currently looking for a way to add content unter posts. Till now I’ve added sign-up forms manually under every post but in the future I’m going to change my freebie.

    And I’m pretty sure, this will happen several times in the future. Is there a plugin or any other way, to put content under every post? I dont want to edit every post I’ve ever created manually 🙂

    Right now, I copy and paste X-Shortcodes at the end, f.e.: http://www.adsventure.de/instagram-business-profil-beitraege-bewerben/

    Thanks 🙂

    #1151398
    Christian
    Moderator

    Hey there,

    X has a hook after the content. See https://community.theme.co/kb/customization/actions-and-filters-in-x/ for more details.

    Here’s a usage example, please add the code below in your functions.php

    // Add content after post
    
    add_action('x_before_the_content_end', 'content_after_single_post');
    
    function content_after_single_post() {
      echo do_shortcode('[recent_posts count="2"]');
    }

    Hope that helps. 🙂

    #1153359
    flittrst
    Participant

    Hey Christian,

    many thanks for your feedback. Just to be sure if this would be right. In my case I should add the following code in the functions php of my child theme (?):

    // Add content after post
    
    add_action('x_before_the_content_end', 'content_after_single_post');
    
    function content_after_single_post() {
      echo do_shortcode('[cs_content][cs_section bg_color="rgb(0, 163, 227)" parallax="false" style="margin: 0px 0px 25px;padding: 0px 0px 15px;"][cs_row inner_container="true" marginless_columns="false" style="margin: 0px auto;padding: 0px;"][cs_column fade="false" fade_animation="in" fade_animation_offset="45px" fade_duration="750" type="1/1" style="padding: 0px;"][x_custom_headline level="h3" looks_like="h3" accent="false" class="cs-ta-center" style="font-size: 1.5em;color: #fff;letter-spacing: 0.03em;"]HOL DIR JETZT MEINEN GRATIS TOOL-GUIDE INKLUSIVE:[/x_custom_headline][x_gap size="15px"][cs_icon_list][cs_icon_list_item title="11 kostenlose Social Media Advertising Tools für Facebook, Instagram & Twitter" type="check-circle" link_enabled="false" link_url="#" link_new_tab="false" style="color: #fff;"]11 kostenlose Social Media Advertising Tools für Facebook, Instagram & Twitter[/cs_icon_list_item][cs_icon_list_item title="Die besten Tipps regelmäßig per E-Mail" type="check-circle" link_enabled="false" link_url="#" link_new_tab="false" style="color: #fff;"]Die besten Tipps regelmäßig per E-Mail[/cs_icon_list_item][/cs_icon_list][cs_text][x_subscribe form="277"][/cs_text][/cs_column][/cs_row][/cs_section]');
    }
    

    Would this work? 🙂

    Thanks!

    #1153438
    Christian
    Moderator

    Yes. Let us know how it goes. 🙂

    #1153495
    flittrst
    Participant

    Works totally fine – many thanks 🙂

    One last question: will this be added to the end of the rss feed? I guess that it isn’t added, right? 🙂

    Thx!

    #1153511
    Rahul
    Moderator

    That’s right!

    Thanks

    #1154707
    flittrst
    Participant

    Perfect – but I need one last hack 🙂

    Right now, this content also appears at the end of every page, not only at the end of blog posts.

    I only want to add this at the end of my blog posts, for example here: http://www.adsventure.de/f-commerce-facebook-werbung-online-shops/

    But right now its also on a regular page, for example here: http://www.adsventure.de/starte-hier/

    How can I fix that? Many thanks 🙂

    #1154721
    Friech
    Moderator

    Hi There,

    You can update your code to this:

    // Add content after post
    
    add_action('x_before_the_content_end', 'content_after_single_post');
    
    function content_after_single_post() {
      if ( is_single() ) {
      echo do_shortcode('[cs_content][cs_section bg_color="rgb(0, 163, 227)" parallax="false" style="margin: 0px 0px 25px;padding: 0px 0px 15px;"][cs_row inner_container="true" marginless_columns="false" style="margin: 0px auto;padding: 0px;"][cs_column fade="false" fade_animation="in" fade_animation_offset="45px" fade_duration="750" type="1/1" style="padding: 0px;"][x_custom_headline level="h3" looks_like="h3" accent="false" class="cs-ta-center" style="font-size: 1.5em;color: #fff;letter-spacing: 0.03em;"]HOL DIR JETZT MEINEN GRATIS TOOL-GUIDE INKLUSIVE:[/x_custom_headline][x_gap size="15px"][cs_icon_list][cs_icon_list_item title="11 kostenlose Social Media Advertising Tools für Facebook, Instagram & Twitter" type="check-circle" link_enabled="false" link_url="#" link_new_tab="false" style="color: #fff;"]11 kostenlose Social Media Advertising Tools für Facebook, Instagram & Twitter[/cs_icon_list_item][cs_icon_list_item title="Die besten Tipps regelmäßig per E-Mail" type="check-circle" link_enabled="false" link_url="#" link_new_tab="false" style="color: #fff;"]Die besten Tipps regelmäßig per E-Mail[/cs_icon_list_item][/cs_icon_list][cs_text][x_subscribe form="277"][/cs_text][/cs_column][/cs_row][/cs_section]');
      }
    }

    Hope it helps, Cheers!

    #1154757
    flittrst
    Participant

    Thanks! 🙂

    #1154843
    Christopher
    Moderator

    You’re welcome.

  • <script> jQuery(function($){ $("#no-reply-1151387 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>