Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   Managing content display on the main page of the site (http://forum.bytesforall.com/showthread.php?t=20743)

mobilechad Aug 7, 2013 07:30 AM

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.

jerryc Aug 7, 2013 09:29 AM

If you want to use more php than the limited allowed code, you need one or more plugins.

Here's what worked for me.

mobilechad Aug 9, 2013 03:55 AM

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?

juggledad Aug 9, 2013 04:57 AM

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

mobilechad Aug 14, 2013 10:14 AM

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

juggledad Aug 14, 2013 11:33 AM

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;}


mobilechad Aug 14, 2013 03:58 PM

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!

juggledad Aug 14, 2013 04:07 PM

?? looks fine in chrome on the mac. did you clear your cache? after all you have a caching plugin active....

mobilechad Aug 14, 2013 04:25 PM

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.

juggledad Aug 14, 2013 05:44 PM

1 Attachment(s)
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

mobilechad Aug 14, 2013 06:32 PM

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.

mobilechad Aug 15, 2013 09:45 AM

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

juggledad Aug 15, 2013 10:29 AM

go to mto->export import and copy the export to a text file and attach it to a reply

mobilechad Aug 15, 2013 11:18 AM

Here you go

juggledad Aug 15, 2013 02:40 PM

You need to save the export as a TEXT file, not a Word doc

mobilechad Aug 15, 2013 03:10 PM

1 Attachment(s)
Uploaded the wrong one. Here you go.

juggledad Aug 15, 2013 03:36 PM

Please shutoff your caching plugin and flush the caches and test it again - your settings work fine for me.

lmilesw Aug 15, 2013 09:41 PM

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?

mobilechad Aug 16, 2013 05:33 PM

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!

mobilechad Aug 16, 2013 05:35 PM

I figured out the caching issue btw - I turned off the plugin but forgot about Photon, one of the components in Jetpack.

lmilesw Aug 16, 2013 08:24 PM

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.

mobilechad Aug 18, 2013 08:54 AM

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

juggledad Aug 18, 2013 09:26 AM

Your gallery images look like thumbnails now...

mobilechad Aug 19, 2013 10:26 AM

#&*! 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.


All times are GMT -6. The time now is 04:19 AM.

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