telophase: (Near - que?)
telophase ([personal profile] telophase) wrote2014-07-10 01:26 pm

Wordpress guys?

I'm using the Magazine Basic theme for this year's iteration of the ConDFW website, and there's one thing I'd like to do: have the sticky post and the first post beneath that on the home page supply the full content of that post, and the rest of them supply just excerpts. I figure I ought to be able to do this with an if...then statement, but (a) I don't know what I'm counting and (b) I don't know which file to put it in. (I think the answer to the latter is content.php, but given that you can change all the posts to excerpts or full-content from the admin area, I don't see where that plugs into content.php...)

Any ideas?

edit: I've answered (a), I think, by putting my own counter right before The Loop, and incrementing it right before The Loop loops, but (b) still eludes me, as editing content.php did absolutely nothing. Bah.

[identity profile] sleary.livejournal.com 2014-07-10 06:44 pm (UTC)(link)
The admin setting probably applies only to RSS feeds.

Look for this in your theme file: http://codex.wordpress.org/Class_Reference/WP_Query#Standard_Loop

It probably has the_content() in there somewhere, which is the function that displays the full post. What you need instead (off the top of my head, with no testing whatsoever) is probably something like:

if ( is_sticky() || 1 == $current_post )
the_content();
else
the_excerpt();


See also http://codex.wordpress.org/Conditional_Tags

[identity profile] telophase.livejournal.com 2014-07-10 06:48 pm (UTC)(link)
The one I'm talking about is a theme option and changes the front page from excerpts-only to content-only--the default is excerpt-only and I changed it to full because the most recent update being an excerpt isn't going to hack it for us. :) (Magazine Basic is a pretty powerful theme for a free, basic one, and I'd buy the premium version if I could convince Amie to go for $69 for it!)

Thanks--I'll try to find it. It's a bit difficult poring through the code (well, for me, as I'm rusty because I do this once a year!) because there's specialized code in there to allow us to change the front page in various ways. But I shall persevere! because the option is...er, doing actual work. :/

[identity profile] sleary.livejournal.com 2014-07-10 06:52 pm (UTC)(link)
Ah! Theme options -- that makes sense.

If you'd like to send me the files, I'll find the right bit and fix it for you.

[identity profile] telophase.livejournal.com 2014-07-10 07:00 pm (UTC)(link)
Wow, thanks! :D Sent!