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)
-   -   Need Help Adding PHP in 3.7.3 In Posts (http://forum.bytesforall.com/showthread.php?t=19040)

genuwine4532 Dec 4, 2012 04:57 PM

Need Help Adding PHP in 3.7.3 In Posts
 
I know PHP is no longer supported in settings for Ata 3.7.3

But I want to add a php shortcode for the plugin Similar Posts below posts in the footer, how can this be done in the backend files?

There is no single.php, so where do I do it?

Thanks

juggledad Dec 4, 2012 05:17 PM

index.php controls the loop.

genuwine4532 Dec 4, 2012 05:39 PM

oh, I did not realize that controls individual posts as well? On other themes it's usually just home page only, no?

Where exactly is the INDIVIDUAL POSTS - AFTER POSTS (footer) section in this code

Code:

<?php
list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options();
get_header();
extract($bfa_ata);
?>


<?php /* If there are any posts: */
if (have_posts()) : $bfa_ata['postcount'] = 0; /* Postcount needed for option "XX first posts full posts, rest excerpts" */ ?>

        <?php // Deactivated since 3.6.5
        # include 'bfa://content_above_loop';
        // Uses the following static code instead: ?>

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

        <?php while (have_posts()) : the_post(); $bfa_ata['postcount']++; ?>
       
                <?php // Deactivated since 3.6.5
                #include 'bfa://content_inside_loop';
                // Uses the following static code instead: ?>
                <?php bfa_next_previous_post_links('Top'); // For SINGLE post pages if activated at ATO -> Next/Previous Navigation  ?>
                <?php /* Post Container starts here */
                if ( function_exists('post_class') ) { ?>
                <div <?php if ( is_page() ) { post_class('post'); } else { post_class(); } ?> id="post-<?php the_ID(); ?>">
                <?php } else { ?>
                <div class="<?php echo ( is_page() ? 'page ' : '' ) . '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 -->




                                               
        <?php endwhile; ?>

        <?php // Deactivated since 3.6.5
        # include 'bfa://content_below_loop';
        // Uses the following static code instead: ?>
        <?php bfa_next_previous_post_links('Middle'); // Displayed on SINGLE post pages if activated at ATO -> Next/Previous Navigation: ?>
        <?php bfa_get_comments(); // Load Comments template (on single post pages, and static pages, if set on options page): ?>
        <?php bfa_next_previous_post_links('Bottom'); // Displayed on SINGLE post pages if activated at ATO -> Next/Previous Navigation: ?>
        <?php bfa_archives_page('<div class="archives-page">','</div>'); // Archives Pages. Displayed on a specific static page, if configured at ATO -> Archives Pages: ?>
        <?php bfa_next_previous_page_links('Bottom'); // Displayed on MULTI post pages if activated at ATO -> Next/Previous Navigation: ?>

<?php /* END of: If there are any posts */
else : /* If there are no posts: */ ?>

<?php // Deactivated since 3.6.5
#include 'bfa://content_not_found';
// Uses the following static code instead: ?>
<h2><?php _e('Not Found','atahualpa'); ?></h2>
<p><?php _e("Sorry, but you are looking for something that isn't here.","atahualpa"); ?></p>

<?php endif; /* END of: If there are no posts */ ?>

<?php get_footer(); ?>


juggledad Dec 4, 2012 05:44 PM

HTML Code:

                <?php bfa_post_footer('<div class="post-footer">','</div>'); ?>
is what handles the footer for posts and pages.

genuwine4532 Dec 4, 2012 06:06 PM

Quote:

Originally Posted by juggledad (Post 93353)
HTML Code:

                <?php bfa_post_footer('<div class="post-footer">','</div>'); ?>
is what handles the footer for posts and pages.

Thank you, but anything that is placed under that also shows in Multi Posts Pages - like Category and Home Page.

Can you please give the code to make it displays on INDIVIDUAL POSTS only?

AND

Individual Pages too?

juggledad Dec 4, 2012 06:40 PM

wrap the code in a php if testing for a single page or a page page. You can find the tests in the wordpress codex.

genuwine4532 Dec 4, 2012 06:58 PM

Quote:

Originally Posted by juggledad (Post 93361)
wrap the code in a php if testing for a single page or a page page. You can find the tests in the wordpress codex.

Okay,

Can you give me the link for that fix for Ata 3.6 not showing live in certain cases?

I read about it somewhere on the forum at one point, I tried search but nothing comes up. It was a bug fix of some sort, either 3.6 not showing up in new Wordpress versions, or PHP versions or certain hostings?

genuwine4532 Dec 4, 2012 07:59 PM

By the way, for anybody who wants the fix to this I was finally able to get it right:

To add PHP code or shortcodes into Footer of single posts:

Add this code into the index.php

Code:

<?php if ( is_single() ) { ?>
<?php YOUR PHP CODE HERE ?>
<?php } ?>

right AFTER the code below in index.php (it's towards the bottom of the page)

Code:

<?php bfa_post_footer('<div class="post-footer">','</div>'); ?>
Use it for Similar Posts plugin shortcodes and anything else you want to place in PHP code in ATA versions 3.6+ that don't allow PHP anymore in Admin Configurations - Post Page Info Items or the Loop


All times are GMT -6. The time now is 09:53 AM.

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