Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Montezuma Theme »

Managing content display on the main page of the site


  #1  
Old Aug 7, 2013, 07:30 AM
mobilechad
 
15 posts · Apr 2013
Managing content display on the main page of the site

I'm trying to get my content set up such that the latest post always shows the full content, and the later ones only show excerpts. I've updated postformat.php with a loop as follows:

...
<div class="post-bodycopy cf">

<div class="post-date">
<p class="post-month"><?php the_time( 'M' ); ?></p>
<p class="post-day"><?php the_time( 'j' ); ?></p>
<p class="post-year"><?php the_time( 'Y' ); ?></p>
</div>

<?php if (have_posts()) : $count = 0;
while (have_posts());
$count++;

if ($count == 1) : the_content();

else : the_excerpt();

endif;
endwhile;
endif;
?>

</div>

...

The problem here is that:
1. It's echo'ing some of the code to be rendered in the browser (count++, count ==)
2. It doesn't seem to work as expected - it renders the content in 3 sections for each post with multiple duplicate sharing buttons.

It's the standard mullet loop taken from this site:
http://perishablepress.com/easily-ad...oop-templates/

I'm kind of at a dead-end with it - I've tried a bunch of different formatting things, like having each line of code individually start with <?php and end with ?>, but that functioned 100% the same as the above.

Is there someplace else I should be writing this code, or something with Montezuma that would prevent it from working?

I'm new to Wordpress/PHP - so apologies if this is a basic error. Thanks in advance for any help.
  #2  
Old Aug 7, 2013, 09:29 AM
jerryc
 
367 posts · Oct 2012
Florida
If you want to use more php than the limited allowed code, you need one or more plugins.

Here's what worked for me.
  #3  
Old Aug 9, 2013, 03:55 AM
mobilechad
 
15 posts · Apr 2013
Thanks Jerry. But that option won't work in the templates or sub-templates, will it? Even with the insert_php plugin activated, I'm still seeing my actual code being rendered on the page vs. the correct post content - it's actually worse because instead of just ignoring most of the PHP code when rendering, it's now rendering it all and skipping the content entirely.

Has anyone else hacked Montezuma to do this before that can share their methods?
  #4  
Old Aug 9, 2013, 04:57 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
1) edit postformat.php and replace
HTML Code:
<?php bfa_excerpt( 55, ' ...' ); ?>
with
HTML Code:
<?php dynamic_sidebar( 'IN LOOP' ); ?>
2) install the plugin 'exec php' and activate it
3) view the front page
4) go to dashboard->appearances->widgets
5) add a text widget to the 'IN LOOP' widget area
6) add the following to the text widget
HTML Code:
<?php
global $wp_query;
if ($wp_query->current_post == 0) 
    the_content();
else
    bfa_excerpt( 55, ' ...' ); 
?>
7) consider donating if you'ld like to continue to get good answers
  #5  
Old Aug 14, 2013, 10:14 AM
mobilechad
 
15 posts · Apr 2013
Thanks juggledad - that worked like a charm with one exception:

If you look at my site now (mobilechad.com), it looks like some line breaks are added such that the first paragraph isn't wrapping next to the date anymore - it's showing up underneath it. I mucked around with Firebug a little bit, but I couldn't seem to figure out what to change to get it to appear the way it used to.

Also, I donated (directly to you) - I do appreciate the time you take to answer these.
--mobilechad
  #6  
Old Aug 14, 2013, 11:33 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
add the following to the end of MTO->CSS Files->clearfix.css
HTML Code:
.post-bodycopy aside.cf:before,
.post-bodycopy aside.cf:after {clear: none;}

Last edited by juggledad; Aug 15, 2013 at 10:16 AM.

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
PAGE NOT FOUND while managing plugins ronakonly Plugins & Atahualpa 1 Jan 16, 2011 04:47 AM
Content not showing on main page freedomrains Center area post/pages 11 Apr 27, 2010 05:03 AM
Static page will not display content siefert Center area post/pages 9 Jan 22, 2010 10:32 AM
Front Page - Main content code murdoco Header configuration & styling 1 Jun 30, 2009 05:56 AM
managing ftp site - maybe not in windows? help qldfilmlocations Header configuration & styling 1 May 13, 2009 06:40 PM


All times are GMT -6. The time now is 10:56 AM.


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