Tagged: x
-
AuthorPosts
-
June 26, 2016 at 5:37 am #1059941
flysocalParticipantIs it possible to have a static comment at the bottom of every single blog post? Something like “Thanks for reading and make sure to visit this <hyperlink> page.” Since it wouldn’t change… maybe CSS is the answer?
I could enter it at the end of every single post… but in that case, it would also show at the end of every post that shows on the main blog page. I’m trying to avoid this.
Thanks,
June 26, 2016 at 6:09 am #1059986
ThaiModeratorHey There,
Please add the following code under functions.php file locates in your child theme:
add_action( "x_after_the_content_end", "x_add_text" ); function x_add_text() { ?> <p class="x-custom-text">Thanks for reading and make sure to visit this <a href="http://www.yourwebsite.com/">link</a> page.</p> <?php }Hope it helps 🙂
June 26, 2016 at 11:14 pm #1060834
flysocalParticipantHi there.
We’re close. Two issues;
1. While it does show at the bottom of every post, I don’t want it to show at the bottom of every post when on the landing page. Only when viewing the individual post.
2. Can a blank line be inserted above this modification, so it seems like a new paragraph and not a run on sentence?Thanks for the help.
June 26, 2016 at 11:39 pm #1060853
Rue NelModeratorHello There,
Thanks for the updates! To resolve this issue, please have the code updated and make use of this code instead:
// Custom Static Text // ============================================================================= function x_add_text() { ?> <?php if ( is_single() ) : ?> <hr class="x-hr mtm mbm" style="border-top-color: #000; border-top-width: 2px;"> <p class="x-custom-text">Thanks for reading and make sure to visit this <a href="http://www.yourwebsite.com/">link</a> page.</p> <?php endif; ?> <?php } add_action( "x_after_the_content_end", "x_add_text" ); // =============================================================================Feel free to change the color of the line.
June 27, 2016 at 12:03 am #1060880
flysocalParticipantThat did provide the space I wanted via a border. Can it be moved up to right under my blog content and right above my back/forward buttons?
Also, instead of a link to the URL I typed in functions.php, it just shows “link” as a hyperlink. Maybe a typo?
Thanks for the help.
June 27, 2016 at 12:10 am #1060889
Paul RModeratorHi,
Please change the code to this.
// Custom Static Text // ============================================================================= function x_add_text() { ?> <?php if ( is_single() ) : ?> <hr class="x-hr" style="border-top-color: #000; border-top-width: 2px; margin-bottom:20px;margin-top:20px;"> <p class="x-custom-text">Thanks for reading and make sure to visit this <a href="http://www.yourwebsite.com/">link</a> page.</p> <?php endif; ?> <?php } add_action( "x_after_the_content_end", "x_add_text" ); // =============================================================================Change margin bottom and margin top to adjust spacing.
Then change the URL and the text link in the code.
Hope that helps
June 27, 2016 at 12:58 am #1060919
flysocalParticipantStill have an issue with placement. I can adjust the margins… but I don’t think it’s going to accomplish what I’m looking for.
I’m trying to get a couple of spaces after the last post text content… then the custom static text we’re working on. It should almost seem as part of the post content… just a static portion.Thanks,
June 27, 2016 at 1:06 am #1060929
ChristopherModeratorHi there,
Please provide us with URL of page in question.
Thanks.
June 27, 2016 at 1:44 am #1060973
flysocalParticipantThis reply has been marked as private.June 27, 2016 at 2:05 am #1061001
Rue NelModeratorHello There,
Thanks for providng the url. I went ahead and updated the code. I ended up having this code instead:
// Custom Static Text // ============================================================================= function x_add_text($content) { if ( is_single() ) { $content .= '<hr class="x-hr" style="border-top-color: #ada7a4; border-top-width: 2px; margin-bottom:20px;margin-top:0px;">'; $content .= '<p class="x-custom-text">Thanks for reading and make sure to visit this and make it much better and much more interesting <a href="http://www.cruisingvolare.com/about">CruisingVolare</a> page.</p>'; } return $content; } add_filter( "the_content", "x_add_text", 5 ); // =============================================================================Hope this would work out for you.
June 27, 2016 at 2:20 am #1061021
flysocalParticipantPerfect! That’s exactly the look I was trying to accomplish.
I really appreciate your prompt service!
Thanks again to the Themeco team!
June 27, 2016 at 2:40 am #1061046
Paul RModeratorYou’re welcome! 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1059941 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
