Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   New Versions, & Updating (http://forum.bytesforall.com/forumdisplay.php?f=12)
-   -   [SOLVED] Upgrading ATA 3.3.2 to 3.4.2 only half successful (http://forum.bytesforall.com/showthread.php?t=3392)

Shepherd Jim Sep 11, 2009 09:48 AM

[SOLVED] Upgrading ATA 3.3.2 to 3.4.2 only half successful
 
I'm able to successfully upgrade my personal test site from Atahualpa 3.3.2 to the latest 3.4.2. --

Note: I did it the old-fashioned way, FTP uploading the new directory "atahualpa342" into "/wp/wp-content/themes/". In the WordPress Dashboard I'm able to choose/switch -- activating either version of Atahualpa.

http://www.shepherdjim.com/

Unfortunately, I have custom code inserted into the theme's "index.php" file which creates the "Hatchtown Update" box on the landing page. The code that was created awhile back under Flynn's direction takes the latest blog post in the "Announcements" and puts it in the box on the front page.

When I insert the code block into index.php the site crashes -- the browser screen shows:

Parse error: syntax error, unexpected $end in /home/content/m/i/n/mineolajim/html/wp/wp-content/themes/atahualpa342/index.php on line 114


I've looked at the new and old index.php's and there's quite a difference.

Help!

juggledad Sep 14, 2009 08:46 AM

strange, there is no line 114 in index.php and I've been using both swapping bacling forth for awhile now. I'll send you a PM about looking at it

Shepherd Jim Sep 14, 2009 09:31 AM

HeyJDad!

It's the index.php that's contained in the Atahualpa root directory "shepherdjim.com/wp/wp-content/themes/atahualpa332/index.php"

In Ata 332 -- currently running at http://www.shepherdjim.com/

index.php has 347 lines

In Ata 342

the new index.php has 40 lines (obviously been some big changes in what index.php is doing!!)

The full index.php in Ata 332 running on the site has 425 lines because, as I said, I've inserted "custom code" -- the block is in place immediately following:

<?php get_header(); ?>

When I insert the same block of code in the new (Ata 342) index.php the site breaks.

Here's the block of "custom code":

<!-- EC3 start = post my announcements category +++++++++++++++++++++++++++++++++ -->
<?php if ( is_front_page() ) { ?>
<div class="ec3ctr">
<div class="announce">
<h3 style="text-align: center; color: #797C00;">Hatchtown Update</h3>
<?php $my_query = new WP_Query('category_name=announcements&showposts=1' );
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<!-- ++++ -->
<!-- Post Headline -->
<div class="post-headline">
<h2><?php
if( !is_single() AND !is_page() ) { ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php
if (function_exists('the_title_attribute')) {
the_title_attribute();
}
elseif (function_exists('the_title')) {
the_title();
} ?>"><?php
} the_title();
if( !is_single() AND !is_page() ) { ?>
</a><?php
} ?>
</h2>
</div>


<!-- ++++ -->

<?php // Post Byline
if( (is_home() && $bfa_ata_post_byline_home != "") OR
(is_page() && $bfa_ata_post_byline_page != "") OR
(is_single() && $bfa_ata_post_byline_single != "") OR
( (is_archive() OR is_search() OR is_author() OR is_tag()) && $bfa_ata_post_byline_multi != "") ) {
echo '<div class="post-byline">';
if ( is_home() ) { echo postinfo("$bfa_ata_post_byline_home"); }
elseif ( is_page() ) { echo postinfo("$bfa_ata_post_byline_page"); }
elseif ( is_single() ) { echo postinfo("$bfa_ata_post_byline_single"); }
else { echo postinfo("$bfa_ata_post_byline_multi"); }
echo '</div>';
} ?>

<!-- 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();
} ?>
</div>

<?php // Post Footer
if( (is_home() && $bfa_ata_post_footer_home != "") OR
(is_page() && $bfa_ata_post_footer_page != "") OR
(is_single() && $bfa_ata_post_footer_single != "") OR
( (is_archive() OR is_search() OR is_author() OR is_tag()) && $bfa_ata_post_footer_multi != "") ) {
echo '<div class="post-footer">';
if ( is_home() ) { echo postinfo("$bfa_ata_post_footer_home"); }
elseif ( is_page() ) { echo postinfo("$bfa_ata_post_footer_page"); }
elseif ( is_single() ) { echo postinfo("$bfa_ata_post_footer_single"); }
else { echo postinfo("$bfa_ata_post_footer_multi"); }
echo '</div>';
} ?>

<!-- EC3 end of my announce div +++++++++++++++++++++++++++++++++++ -->

I'm guessing, if my block of code will still work, it'll have to be "inserted" somewhere new.

Jim

juggledad Sep 14, 2009 10:52 AM

This code looks like it could go in 'The LOOP' - see ATO->Style & edit CENTER COLUMN->The LOOP

Shepherd Jim Sep 14, 2009 02:58 PM

Wow! There are some big changes in the ATO "control suite" !!

Sorry, but I'll need more hints. I took the old block of code that Flynn had long ago cooked for me and inserted it in various places in both the "loop" and "before the loop" windows at ATO->Style & edit CENTER COLUMN->The LOOP with no joy. I would always get the front_page but my "Hatchtown Update" would NOT appear -- AND I'd get some variation of the error notice:
"Parse error: syntax error, unexpected $end in /home/content/m/i/n/mineolajim/html/wp/wp-content/themes/atahualpa342/functions.php(396) : eval()'d code on line 82"
I'm wondering if there might not nowadays be some other way to skin this cat.

If you look at http://www.shepherdjim.com/, all that's happening is that the latest post in the category "Announcements" is appearing in the box at the top of the center column of the home/landing static page.

Jim

juggledad Sep 15, 2009 03:03 PM

let me see if I understand

1) your landing page is not the blog, just a page
2) you have a category called 'Announcements' (and other categories)
3) the latest post in the a'announcements is sisplayed in a box on the landing page

Have I got that right?

Shepherd Jim Sep 15, 2009 05:36 PM

Quote:

Originally Posted by juggledad (Post 14694)
let me see if I understand

1) your landing page is not the blog, just a page
2) you have a category called 'Announcements' (and other categories)
3) the latest post in the Announcements is displayed in a box on the landing page

Have I got that right?

That's it in the proverbial nutshell!

It's a neat way to have the classic static "home page" but with a easily and quickly updatable "notice area". The plan is to move this over to the main, business site where my wife Pam will be able to post updates to the home page without "disturbing" the rest of the page.

Jim

Flynn Sep 15, 2009 07:29 PM

Try adding the following at the bottom of Atahualpa Theme Options -> Style & Edit CENTER COLUMN -> Content ABOVE the LOOP:


PHP Code:

<?php if ( is_front_page() ) { ?>
    <div class="ec3ctr">
        <div class="announce">
            <h3 style="text-align: center; color: #797C00;">Hatchtown Update</h3>
            <?php $my_query = new WP_Query('category_name=announcements&showposts=1' );
            while (
$my_query->have_posts()) : $my_query->the_post(); ?>
                <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
                    <?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_footer('<div class="post-footer">','</div>'); ?>
                </div>
            <?php endwhile; ?>
        </div>
    </div>
<?php ?>

Looks like you're not using a Byline or Footer anyway so you could leave out these lines:

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

and

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

Shepherd Jim Sep 16, 2009 07:29 AM

Flynn and Juggledad! BIG thanks to you both. I have, of course, just pressed both your PayPal buttons. :)

Flynn, that new code snippet worked wonderfully. I inserted it in the "Content ABOVE the LOOP" window following the three lines of default code:

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

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

<?php /* For the plugin Page2Cat http://wordpress.org/extend/plugins/page2cat/ */
if( is_category() AND function_exists('page2cat_output')) { page2cat_output($cat); } ?>


...you didn't specifically mention whether the new stuff should precede, follow or replace. :o

QUESTION: Am I right in thinking that adding this custom code in the ATO means that this will be "backed up" in the WP database? When I install the next Atahualpa update I will not have to re-insert this "hack."??

AWESOME! Thanks again!

Another Happy Customer: Jim

juggledad Sep 16, 2009 07:42 AM

Yep it's now in the db

Shepherd Jim Sep 16, 2009 08:43 AM

Quote:

Originally Posted by juggledad (Post 14749)
Yep it's now in the db

Fantastic! One click to update WordPress. One click to update Atahualpa. I better watch out, with so little to worry about my brain will atrophy.

Thanks again! I'm off to feed the sheep and pigs with a clear mind! :) :)

Jim

juggledad Sep 16, 2009 10:53 AM

created a HOW TO thread (http://forum.bytesforall.com/showthr...4758#post14758) describing how to do this!


All times are GMT -6. The time now is 05:27 PM.

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