Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   [SOLVED] How to Add Text to ALL Posts? (http://forum.bytesforall.com/showthread.php?t=1190)

strangelove Apr 9, 2009 11:13 AM

[SOLVED] How to Add Text to ALL Posts?
 
I wish to add a few lines of text to all posts (and occassionally change the text, probably), at the BOTTOM of the post -- not in the byline or the footer areas.

Is this possible (without editing every post)?

Dr. Strangelove
Watching YouTube

paulae Apr 9, 2009 03:19 PM

If I'm not mistaken, you could add it in the body of your index.php file, but then you'd have to re-edit it to change it.

I did this to create some custom templates for certain categories, where I wanted certain text and photos to appear on every post in that category. For instance, at http://www.larchmontgazette.com/2009...e-right-place/ , the intro text at the top, the photo and text under the photo and the Ask a question form are built into the template.

Here is what the new template looks like, where I put the photo, text under the photo and the question form:

Code:

<!-- Post Body Copy -->                               
                <div class="post-bodycopy clearfix">
                <?php if ((is_home() && $bfa_ata_excerpts_home == "Full Posts") OR
                (is_category() && $bfa_ata_excerpts_category == "Full Posts") OR
                (is_date() && $bfa_ata_excerpts_archive == "Full Posts") OR
                (is_tag() && $bfa_ata_excerpts_tag == "Full Posts") OR
                (is_search() && $bfa_ata_excerpts_search == "Full Posts") OR
                (is_author() && $bfa_ata_excerpts_author == "Full Posts") OR
                is_single() OR
                is_page() OR (is_home() AND !is_paged() AND $postcount <= $bfa_ata_full_posts_homepage) ) {
                        $bfa_ata_more_tag_final = str_replace("%post-title%", the_title('', '', false), $bfa_ata_more_tag);
                        the_content(bfa_escape($bfa_ata_more_tag_final));

                } else {
                        the_excerpt();
                } ?>

        <p align="center"><img src="/wp27/wp-content/uploads/2009/03/3gardeners.jpg" width="350"></p>
Ann Mangone, Jennifer Jensen and Toni Porter have completed the Cornell Cooperative Extension of Westchester's Master Gardener Program, and are active in gardening-related activities in the community. You may have seen them last summer at the Master Gardener Booth at the Larchmont Farmers Market, where they will be offering advice again this year beginning in June.       
<h5><a name="form"></a>Ask a question about your garden:</h5>
            <form name="Garden Guide" method="POST" action="/cgi-pub/FormMail/">

              <p> Name:
                <input type="text" name="name">
                <INPUT TYPE="HIDDEN" NAME="recipient" VALUE="garden@larchmontgazette.com">
                <INPUT TYPE="HIDDEN" NAME="SUBJECT" VALUE="Garden">
                <INPUT TYPE="HIDDEN" NAME="REPLY-TO" VALUE="garden@larchmontgazette.com">
                <INPUT TYPE="HIDDEN" NAME="FROM" VALUE="garden@larchmontgazette.com">
              </p>
              <p>Email:
                <input type="text" name="email">

              </p>
              <p>Question:</p>
              <textarea name="question" cols="40" rows="10"></textarea>
              <p></p>
              <p>
                <input type="submit" name="Submit" value="Submit">
                <input name="Reset" type="reset" id="Reset" value="Erase">
              </p>

            </form>


</div>

                                               
                <?php // Post Pagination
                if ((is_home() && $bfa_ata_excerpts_home == "Full Posts") OR
                (is_category() && $bfa_ata_excerpts_category == "Full Posts") OR
                (is_date() && $bfa_ata_excerpts_archive == "Full Posts") OR
                (is_tag() && $bfa_ata_excerpts_tag == "Full Posts") OR
                (is_search() && $bfa_ata_excerpts_search == "Full Posts") OR
                (is_author() && $bfa_ata_excerpts_author == "Full Posts") OR
                is_single() OR
                is_page() ) {
                        wp_link_pages('before=<p class="post-pagination"><strong>' . __('Pages:','atahualpa') . '</strong> &after=</p>&next_or_number=number');
                } ?>

Maybe there is a much easier, cleaner way to do what you want.

Flynn Apr 9, 2009 03:25 PM

You could do this by adding a filter function to the post content. Add the following tightly to the bottom of functions.php without causing any blank lines or spaces:

PHP Code:

<?php        
function bfa_append_to_post($post_body_content) {
$post_body_content $post_body_content 
'YOUR TEXT HERE ....
...MORE TEXT ...
...TEXT ( or HTML) ...'
;
return 
$post_body_content;
}
add_filter('the_content''bfa_append_to_post');
?>


contentfreak Jan 28, 2010 05:12 AM

hello flynn

i am also looking to do the same thing
when i have inserted your code the text below the post, above the comments

i want to insert text above the posts, below the title
is there an easy way to do this?

outofdebtagain Feb 28, 2010 12:53 PM

I have found the PostPost plug-in to work very nicely with Atahualpa. You can choose what to insert before or after content on posts or pages.

Quote:

Originally Posted by contentfreak (Post 24003)

when i have inserted your code the text below the post, above the comments

i want to insert text above the posts, below the title
is there an easy way to do this?

Mrs. Accountability
Out of Debt Again


All times are GMT -6. The time now is 07:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.