Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   How to I add a link To the end of every post?? (http://forum.bytesforall.com/showthread.php?t=6028)

baronsamedi Feb 25, 2010 11:36 AM

How to I add a link To the end of every post??
 
Looking for a way to add a like to the end of every single post? Cant file a file like single.php...

juggledad Feb 25, 2010 12:27 PM

why not put it in the post footer ATO->Edit POST/PAGE INFO ITEMS->FOOTER:xxxxx

baronsamedi Feb 25, 2010 12:41 PM

im lookin to put it at the end of the body... adsense code and a link

juggledad Feb 25, 2010 12:52 PM

you could add code in ATO->Style & edit CENTER COLUMN->The LOOP

baronsamedi Feb 25, 2010 01:07 PM

k i noticed that but i cant get it to not show on the main page...

Code:

<?php
add_filter('the_content', 'my_extra_content', 1);
function my_extra_content($text) {
        return $text . "\n<p><a href=\"http://www.******.com/how-to-download/\">HOW TO DOWNLOAD</a> </p>\n
<p>[ad#Adsense468x15link4]</p>\n";
}
?>

I added that code and it appears on the main page i only want it on single pages,,

juggledad Feb 25, 2010 01:25 PM

so use an 'if is_single() { your code here }

http://codex.wordpress.org/Conditional_Tags

baronsamedi Feb 25, 2010 01:50 PM

k works for my link but seems not to want to work for my adsense code... any ideas??

Code:

<?php if (is_single())
add_filter('the_content', 'my_extra_content', 1);
function my_extra_content($text) {
        return $text . "\n<p><a href=\"http://www.****.com/how-to-download/\">HOW TO DOWNLOAD</a> </p>\n";}?>

This is the working link code... need to know how to add adsense

juggledad Feb 25, 2010 02:00 PM

ohhh, your using a shortcode and this is just being added directly to the HTML that is being generated, the short code is not being expanded.

I think your going to have to put the shortcode in a post, look at the result and tehn copy the html and add that in in place of your shortcode in 'The LOOP'

baronsamedi Feb 25, 2010 02:43 PM

im confused what should i be using???

juggledad Feb 26, 2010 04:57 AM

It looks like you are using a shortcode in this code you are adding into 'The LOOP' - the short code won't be dealt with if it is there. This section is part of the 'processing' logic, it DOES the proce3ssing on teh information, it's not the INFORMATION (I know this is general terms, but I can't think of a better way to explain it)

It would be like putting a shortcode in a widget's php and expecting that code to be expanded. Won't happen.

[shortcode] = 'some chunk of code'

in your code
HTML Code:

<?php
add_filter('the_content', 'my_extra_content', 1);
function my_extra_content($text) {
        return $text . "\n<p><a href=\"http://www.******.com/how-to-download/\">HOW TO DOWNLOAD</a> </p>\n
<p>[ad#Adsense468x15link4]</p>\n";
}
?>

you need to replace the shortcode '[ad#Adsense468x15link4]' with the code it generates if you want it in 'The LOOP'

baronsamedi Feb 26, 2010 07:06 AM

k so i put this code in and nothing came out.



Code:

<?php if (is_single())
add_filter('the_content', 'my_extra_content', 1);
function my_extra_content($text) {
        return $text . "\n<p><a href=\"http://www.promo******.com/how-to-download/\">HOW TO DOWNLOAD</a> </p>\n
<p><script type="text/javascript"><!--
google_ad_client = "**********";
/* 468x15, created 6/30/09 Promo*****Postbottom */
google_ad_slot = "********";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>\n";
}
?>


juggledad Feb 26, 2010 07:44 AM

what is the url?

baronsamedi Feb 26, 2010 09:18 AM

promotorrents.com

paulae Feb 26, 2010 09:22 AM

Why not just put a new widget area where you want it, and then use a text widget or a specialized Adsense plugin widget?

baronsamedi Feb 26, 2010 09:59 AM

im new to template editing.. so ur saying put the codes in a widget then put the widget at the end of the post??

paulae Feb 26, 2010 10:18 AM

Atahualpa lets you create new widget areas. Look at the theme options and read the directions. You can do this without editing any theme files, just through the new widget creation option.

You could of course also create a new template with your added code, but that seem like the messier way to do it.

juggledad Feb 27, 2010 04:37 AM

If I read this right baronsamedi wants the AD to be put at the end of each post's body, before the post footer. (baronsamedi: is that correct?)

Can you copy and paste here teh entire contents of 'The LOOP'

baronsamedi Feb 28, 2010 04:11 PM

Code:

<?php /* For SINGLE post pages if activated at ATO -> Next/Previous Navigation: */
bfa_next_previous_post_links('Top'); ?>

<?php /* Post Container starts here */
if ( function_exists('post_class') ) { ?>
<div <?php if ( is_page() ) { post_class('post'); } else { post_class("$odd_or_even"); } ?> id="post-<?php the_ID(); ?>">
<?php } else { ?>
<div class="<?php echo ( is_page() ? 'page ' : '' ) . $odd_or_even . ' post" id="post-'; the_ID(); ?>">
<?php } ?>

<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>

<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>

<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>

<?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>

<?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?>

<?php bfa_post_footer('<div class="post-footer">','</div>'); ?>

</div><!-- / Post -->


juggledad Feb 28, 2010 04:55 PM

I don't see your code in the LOOP - did you remove it?

docfox Sep 12, 2010 03:29 PM

I've been working on this for days, trying to insert a contact form at the end of each post. I had it working with cform II, but there are other issues with it.

I'm using Fast Secure Contact Form, that uses a 'shortcode' on the page or posts and it works great. But I want to put it into 'The Loop' so I don't have to edit 500 posts individually.

I've followed this thread and have the following:

<? php if (is_single() ) { html of shortcode }; ?>

I tried getting the html of the shorcode using Firefox, but I was getting errors.

Any help would be appreciated,

Thanks, Doc

juggledad Sep 12, 2010 06:27 PM

your php is in error, it should be
HTML Code:

<?php if (is_single() ) { html of shortcode }; ?>
no space between the <? and the php

docfox Sep 12, 2010 08:32 PM

Here is the shortcode: [si-contact-form form='1']

Here is the error I keep getting:

Parse error: syntax error, unexpected '<' in /home/ffstock/public_html/discontinuedkohler.com/wp-content/themes/atahualpa353/functions.php(532) : eval()'d code on line 21

Here is the link to the site: http://www.discontinuedkohler.com

Here is the HTML and php:

<?php if (is_single() ) {

<p>Got Questions - Contact Us!</p>
<!-- Fast Secure Contact Form plugin - begin - http://www.FastSecureContactForm.com -->
<a name="FSContact1" id="FSContact1"></a>
<div style="width: 375px;">

<form action="http://discontinuedkohler.com/contact-us/#FSContact1" id="si_contact_form1" method="post">
<div style="text-align: left;"><span class="required">*</span>(denotes required field)</div>
<div><input name="si_contact_CID" value="1" type="hidden"></div>

<div style="text-align: left; padding-top: 5px;">
<label for="si_contact_name1">Name: <span class="required">*</span></label>
</div>
<div style="text-align: left;">
<input style="text-align: left; margin: 0pt;" id="si_contact_name1" name="si_contact_name" value="" size="40" type="text">
</div>
<div style="text-align: left; padding-top: 5px;">
<label for="si_contact_email1">E-Mail Address: <span class="required">*</span></label>
</div>
<div style="text-align: left;">
<input style="text-align: left; margin: 0pt;" id="si_contact_email1" name="si_contact_email" value="" size="40" type="text">
</div>
<div style="text-align: left; padding-top: 5px;">
<label for="si_contact_subject1">Subject: <span class="required">*</span></label>
</div>
<div style="text-align: left;">
<input style="text-align: left; margin: 0pt;" id="si_contact_subject1" name="si_contact_subject" value="" size="40" type="text">
</div>
<div style="text-align: left; padding-top: 5px;">
<label for="si_contact_message1">Message: <span class="required">*</span></label>
</div>
<div style="text-align: left;">
<textarea style="text-align: left; margin: 0pt;" id="si_contact_message1" name="si_contact_message" cols="30" rows="10"></textarea>
</div>

<div style="text-align: left; padding-top: 5px;">
<label for="si_contact_captcha_code1">CAPTCHA Code: <span class="required">*</span></label>
</div>
<div style="text-align: left;">
<input style="text-align: left; margin: 0pt;" value="" id="si_contact_captcha_code1" name="si_contact_captcha_code" size="6" type="text">
</div>

<div style="text-align: left; padding-top: 5px;">
<div style="width: 250px; height: 65px; padding-top: 5px;">
<img class="ctf-captcha" id="si_image_ctf1" style="border-style: none; margin: 0pt; padding: 0px 5px 0px 0px; float: left;" src="http://discontinuedkohler.com/wp-content/plugins/si-contact-form/captcha-secureimage/securimage_show.php?ctf_form_num=1&amp;prefix=NHTB gsQxFhONhmG8" alt="CAPTCHA Image" title="CAPTCHA Image">
<input id="si_code_ctf_1" name="si_code_ctf_1" value="NHTBgsQxFhONhmG8" type="hidden">
<div id="si_audio_ctf1">
<a id="si_aud_ctf1" href="http://discontinuedkohler.com/wp-content/plugins/si-contact-form/captcha-secureimage/securimage_play.php?ctf_form_num=1&amp;prefix=NHTB gsQxFhONhmG8" rel="nofollow" title="CAPTCHA Audio">
<img src="http://discontinuedkohler.com/wp-content/plugins/si-contact-form/captcha-secureimage/images/audio_icon.png" alt="CAPTCHA Audio" style="border-style: none; margin: 0pt; padding: 0px; vertical-align: top;" onclick="this.blur();"></a>
</div>
<div id="si_refresh_ctf1">
<a href="#" rel="nofollow" title="Refresh Image" onclick="si_contact_captcha_refresh('1','wav','/wp-content/plugins/si-contact-form/captcha-secureimage','http://discontinuedkohler.com/wp-content/plugins/si-contact-form/captcha-secureimage/securimage_show.php?ctf_form_num=1&amp;prefix='); return false;">
<img src="http://discontinuedkohler.com/wp-content/plugins/si-contact-form/captcha-secureimage/images/refresh.png" alt="Refresh Image" style="border-style: none; margin: 0pt; padding: 0px; vertical-align: bottom;" onclick="this.blur();"></a>
</div>
</div>
</div>


<div style="text-align: left; padding-top: 5px;">
<input name="si_contact_action" value="send" type="hidden">
<input name="si_contact_form_id" value="1" type="hidden">
<input style="cursor: pointer; margin: 0pt;" value="Submit" type="submit">
</div>

</form>
</div>

<p style="font-size: x-small; font-weight: normal; padding-top: 5px;">Powered by <a href="http://wordpress.org/extend/plugins/si-contact-form/">Fast Secure Contact Form</a></p>
<!-- Fast Secure Contact Form plugin - end - http://www.FastSecureContactForm.com -->


}; ?>



Thanks for checking this,

Doc

juggledad Sep 13, 2010 06:50 AM

you are mixing your php and html and confusing things. you need to change the first line to
HTML Code:

<?php if (is_single() ) { ?>
to switch from PHP to HTML, then change the last line to
HTML Code:

<?php }; ?>
to switch back to PHP from the HTML

docfox Sep 13, 2010 07:11 AM

Works perfectly. Thank you again for your help.


All times are GMT -6. The time now is 08:58 AM.

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