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 » Montezuma Theme »

Managing content display on the main page of the site


  #1  
Old Aug 7, 2013, 08:30 AM
mobilechad
 
15 posts · Apr 2013
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, 10: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, 04: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, 05:57 AM
juggledad's Avatar
juggledad
 
23,684 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, 11: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, 12:33 PM
juggledad's Avatar
juggledad
 
23,684 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 11:16 AM.
  #7  
Old Aug 14, 2013, 04:58 PM
mobilechad
 
15 posts · Apr 2013
Thanks - works great in Firefox but doesn't seem to work in Chrome. I'll dig around google for a while to see if I can figure out why. Thanks again!
  #8  
Old Aug 14, 2013, 05:07 PM
juggledad's Avatar
juggledad
 
23,684 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
?? looks fine in chrome on the mac. did you clear your cache? after all you have a caching plugin active....
  #9  
Old Aug 14, 2013, 05:25 PM
mobilechad
 
15 posts · Apr 2013
I'm using Chrome on a Mac - cleared cache repeatedly but it makes no difference as far as I can tell. I've attached a screen grab of what I'm seeing.

Last edited by mobilechad; Aug 15, 2013 at 04:09 PM.
  #10  
Old Aug 14, 2013, 06:44 PM
juggledad's Avatar
juggledad
 
23,684 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
odd, cause I'm on a mac and with chrome, this is what I see (Version 28.0.1500.95 of chrome osx 10.7.5)
did you clear the wsites cache since you are using a caching plugin (you should always shutoff caching plugins off when making site changes)

BTW when I click on an immage it comes up BIG does not fit my screen and I'm set at 1920 x 1080. In addition there is a small white triangle about 5 1/2 inches down and 3 1/2 inches from the left edge - it is on all your photos
Attached Thumbnails
Click image for larger version

Name:	chrome.png
Views:	274
Size:	71.8 KB
ID:	2392  

Last edited by juggledad; Aug 14, 2013 at 06:51 PM.
  #11  
Old Aug 14, 2013, 07:32 PM
mobilechad
 
15 posts · Apr 2013
I'm working on the images issue. I'm struggling to find a plug-in that does exactly what I want, and in the process of switching between a few it's left the images in a weird state with some posts working fine and some not.
  #12  
Old Aug 15, 2013, 10:45 AM
mobilechad
 
15 posts · Apr 2013
I'm having two issues with image display on the main page that weren't a problem before I tried out the Lightbox Gallery plug-in. I've since de-activated and removed, then re-activated and removed again trying to return to the original behavior, but with no luck. I've spent about 3 hours looking around the CSS and Googling but can't seem to figure out what Lightbox has done.

Here's the problems:
1. The featured post images are now variable heights based on the original photo size vs. the standardized size Montezuma makes them, and
2. Clicking on a photo in the post itself from the main page opens a very tiny photo box (which is worse than the bug I was trying to fix when I installed Lightbox)

I haven't changed any other CSS or code related to images nor do I have any other plugins installed. I'll keep plugging away but I thought I'd post this in case you'd seen it before.

Thanks,
Chad
  #13  
Old Aug 15, 2013, 11:29 AM
juggledad's Avatar
juggledad
 
23,684 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
go to mto->export import and copy the export to a text file and attach it to a reply
  #14  
Old Aug 15, 2013, 12:18 PM
mobilechad
 
15 posts · Apr 2013
Here you go

Last edited by mobilechad; Aug 15, 2013 at 04:09 PM.
  #15  
Old Aug 15, 2013, 03:40 PM
juggledad's Avatar
juggledad
 
23,684 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
You need to save the export as a TEXT file, not a Word doc
  #16  
Old Aug 15, 2013, 04:10 PM
mobilechad
 
15 posts · Apr 2013
Uploaded the wrong one. Here you go.
Attached Files
File Type: txt montezuma-mobilechad.txt (71.4 KB, 297 views)
  #17  
Old Aug 15, 2013, 04:36 PM
juggledad's Avatar
juggledad
 
23,684 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Please shutoff your caching plugin and flush the caches and test it again - your settings work fine for me.
  #18  
Old Aug 15, 2013, 10:41 PM
lmilesw's Avatar
lmilesw
 
10,174 posts · Jul 2009
Central New York State USA
Also the top picture on the Buyer Beware post is HUGE. It is 4000px by 3000px and over 1.5Mb. This will affect page load time and I have no idea how the caching plugin will handle it.

Is there some reason you didn't optimize and resize it for the web?
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #19  
Old Aug 16, 2013, 06:33 PM
mobilechad
 
15 posts · Apr 2013
Primarily because I'm figuring this out as I go along...

I've been uploading the photos I take unedited to Wordpress, using a plugin to optimize the file size (but not the resolution). Presumably, I want to be using a smaller res photo on featured images (and throughout), but I'm not sure of the best way to do this.

When I run the optimizer it clearly shows there being multiple versions of each image in the media library at different resolutions (full, 150x150, 300x225, 1024x768). What I don't know is whether I should be:
a. Simply uploading smaller res files to begin with, or
b. Somehow referencing the smaller resolution for featured images (e.g. 300x225), or
c. Something else entirely

When I go in to edit the feature image there is an option to scale, but it looks like that scales and saves over the original image which I'd prefer not to do (unless that's the correct way?).

If you guys have a suggestion for good practices here, I'd love some recos and/or implementation details.

Thanks!
  #20  
Old Aug 16, 2013, 06:35 PM
mobilechad
 
15 posts · Apr 2013
I figured out the caching issue btw - I turned off the plugin but forgot about Photon, one of the components in Jetpack.
  #21  
Old Aug 16, 2013, 09:24 PM
lmilesw's Avatar
lmilesw
 
10,174 posts · Jul 2009
Central New York State USA
I generally don't have images larger than 1000px wide or 800px tall at 72DPI and 30% quality. You can use tools like Photoshop or Fotosizer or IrfanView. The last two have free versions.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #22  
Old Aug 18, 2013, 09:54 AM
mobilechad
 
15 posts · Apr 2013
Thanks for the suggestions. I've got a ton of photos (and am taking quite a few each day), so I grabbed a plugin to manage this for me (Imsanity). It re-scales the images to a max height/max width that I can set - automatically on upload. It looks like the weird photo issues I've been having are completely resolved at this point.

Thanks again.
--Chad
  #23  
Old Aug 18, 2013, 10:26 AM
juggledad's Avatar
juggledad
 
23,684 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Your gallery images look like thumbnails now...
  #24  
Old Aug 19, 2013, 11:26 AM
mobilechad
 
15 posts · Apr 2013
#&*! They didn't last night - I verified with all the caching disabled, but then turned it back on. Going to turn it off and see what happens. Thanks for letting me know.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


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


All times are GMT -6. The time now is 03:46 PM.


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