Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Plugins & Atahualpa »

[SOLVED] php code banner inside bfa_post_parts.php


  #1  
Old Dec 30, 2016, 03:36 AM
denisrobinzon
 
12 posts · Sep 2016
Hello and HNY. Please tell me. How to correctly add the banner code so that it appears in the center of the page and only single post page (not excerpts)?

PHP Code:
<?php codbanner(1); ?>
I'm add here in bfa_post_parts.php:

PHP Code:
//        $bfa_toss = the_title('','',false); 
    // in those cases
[b]<div align="center">codbanner(1);</div> [/b]
    $bfa_temp_title = get_the_title();
    if ( $bfa_temp_title == '' ) { ?>
        <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link','atahualpa')?>">Permalink</a><?php 
<div align="center">codbanner(1);</div>
but, after that, the wordpress crashes.

Then, I'm add only the string:
codbanner(1);
PHP Code:
    // in those cases
    
codbanner(1);
    
$bfa_temp_title get_the_title();
    if ( 
$bfa_temp_title == '' ) { ?> 
I saw the following:

Click image for larger version

Name:	bannerbro.jpg
Views:	163
Size:	76.1 KB
ID:	2780

but I need the middle and only single post page?!
  #2  
Old Dec 30, 2016, 10:11 AM
juggledad's Avatar
juggledad
 
23,492 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
You can't just mix HTML and PHP you have to escape it properly. Do a google search to see how it is done.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Mar 11, 2017 at 12:46 PM.
  #3  
Old Jan 3, 2017, 10:44 AM
denisrobinzon
 
12 posts · Sep 2016
Quote:
Originally Posted by juggledad
You can't just mix HTML and PHP you hae to escape it properly. Do a google search to see how it is done.
Ok, I'm found how to add a test message in single page, above the title of the post.
PHP Code:
if (is_single()) {
echo 
'<div align="center">Text in center</div>';} 
and received the following result (in attach):
Click image for larger version

Name:	text_in_center.png
Views:	38
Size:	23.9 KB
ID:	2781
but how, now add php code with banner instead of 'Text in center'
I tried the following option:
PHP Code:
if (is_single()) {
echo '<div align="center"><?php codbanner(1); ?></div>';}
but without result, please help!!!?

Last edited by denisrobinzon; Jan 3, 2017 at 10:48 AM.
  #4  
Old Jan 3, 2017, 04:42 PM
juggledad's Avatar
juggledad
 
23,492 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Now you trying to escape into PHP while in PHP. Try this:
HTML Code:
if (is_single()) {
echo '<div align="center">'; codbanner(1); echo '</div>';}
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Jan 4, 2017, 04:29 AM
denisrobinzon
 
12 posts · Sep 2016
Quote:
Originally Posted by juggledad
Now you trying to escape into PHP while in PHP. Try this:
HTML Code:
if (is_single()) {
echo '<div align="center">'; codbanner(1); echo '</div>';}
Great, work fine now!!!! Thank you for learning!

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modify Google Analytics Code inside Atahualpa. Shrinthra Plugins & Atahualpa 2 Jun 15, 2011 03:22 AM
Unable to add adsense code to header / banner area forwardmover Header configuration & styling 1 Dec 31, 2010 02:47 AM
[SOLVED] Banner inside posts evripidis Excerpts, Read more, Pagination 9 Jul 6, 2009 04:15 PM


All times are GMT -6. The time now is 10:47 PM.


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