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 »

How to not display stickies (or latest posts) as excerpts


  #1  
Old Jun 13, 2013, 07:08 AM
Fux
 
142 posts · Apr 2009
What code would I use if I want posts to be excerpts on multi-post-pages but stickies (or the latest post) to be displayed as a full post on top?

I reckon I would have to put it right before the loop in index.php, kind of like this:

Code:
<div id="content" class="cf col9">

	if is_sticky() the_content( 'full-post' )

	<?php bfa_loop( 'postformat' ); ?>
		
	<?php bfa_content_nav( 'multinav2' ); ?>
		
</div>
where 'full-post' might have to be a separate sub template, differing from 'postformat'. Is that true? (I'm afraid it's terribly wrong...)

Also, how would I go about having all posts displayed as an excerpt except for the latest one, that being displayed in full (an multi-post-pages)?
  #2  
Old Jun 13, 2013, 11:40 AM
CrouchingBruin's Avatar
CrouchingBruin
 
299 posts · Aug 2010
Santa Monica, CA
Just off the top of my head, this is what I might do.

If you understand how the virtual file system works, when the loop formats a post for index.php, it will by default pick postformat.php. If the post happens to be of a special format type (Video, Gallery, etc), it will first look to see if you have a corresponding subtemplate defined (postformat-video.php, postformat-gallery.php, etc). If you have created one, it will use that, otherwise it will use the default postformat.php.

So I would assign all of your stickies to the same post format (look at the Format section in your post editor). Make them all Status, for example. Then I would create a virtual subtemplate called postformat-status.php by copying the postformat.php subtemplate (go to Appearances > Montezuma Options > Subtemplates). In your new postformat-status.php virtual file, change bfa_excerpt to the_content, and that should display the entire content for those posts that you have marked as Status.

Now, did you say you wanted all of the stickies to appear as the first posts, or will Wordpress automatically do that if you've checked off "Stick this post to the front page"?
__________________
My Montezuma-themed sites: ESHS Girls Basketball Team, Venice Hongwanji Buddhist Temple
Please consider making a donation to BytesForAll for their great themes!
  #3  
Old Jun 14, 2013, 01:52 AM
Fux
 
142 posts · Apr 2009
Hey CrouchingBruin -

that makes a lot of sense, thank you very much.

Quote:
Now, did you say you wanted all of the stickies to appear as the first posts, or will Wordpress automatically do that if you've checked off "Stick this post to the front page"?
As far as I know, it (Wordpress) wil do that automatically.

That leaves just one question: How to display the 1 latest post as a full post? Atahualpa offers precisely that option.

I seem to remember to have once read about a counter in the loop that allows you to decide how many posts Wordpress should display as full posts (or whatever) but I don't know how to handle that with the bfa_loop. Is it even an option with bfa_loop or would I have to implement a counter into the template it is calling, which is postformat.php?

Edit: I would use this http://wordpress.org/support/topic/f...st-as-excerpts but don't know how to best combine it with bfa_loop

Last edited by Fux; Jun 14, 2013 at 02:20 AM. Reason: Added a link with example
  #4  
Old Jun 14, 2013, 06:18 AM
lmilesw's Avatar
lmilesw
 
10,174 posts · Jul 2009
Central New York State USA
You could use the TPG Get Posts plugin to place the latest full post at the top of a page using a shortcode and then under that use the shortcode with the offset option to put the excerpts of the following. Then between the two shortcodes put the code for the ad.
__________________
~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.
  #5  
Old Jun 14, 2013, 05:53 PM
CrouchingBruin's Avatar
CrouchingBruin
 
299 posts · Aug 2010
Santa Monica, CA
Quote:
I seem to remember to have once read about a counter in the loop that allows you to decide how many posts Wordpress should display as full posts (or whatever) but I don't know how to handle that with the bfa_loop. Is it even an option with bfa_loop or would I have to implement a counter into the template it is calling, which is postformat.php?
The problem is that the virtual PHP pages (Main Templates & Sub Templates) only allow a limited set of PHP function calls & code. I'm not sure if what you want to do can be accomplished through the virtual templates. You might have to create a physical template, and unfortunately, my knowledge of the WP or BFA functions isn't that great, so I can't offer any suggestions along those lines.

If I had to do it for myself, I'd kludge up something using JavaScript, since that's what I know. I'd set postformat.php to display both the excerpt and the entire post content in their own separate DIVs, and insert some CSS to hide the content DIV so they won't show up by default.

Once the document is loaded (ready), I'd save the sticky posts to an object and delete them temporarily from the document. Then select the first of the remaining posts (which should be the latest), and remove the excerpt DIV and unhide the content DIV. Finally, reinsert the stickies back at the beginning. As I said, not very elegant, kind of kludgy, and it will increase the load time slightly depending upon how how big the posts are, since both the excerpt and the entire post content are loaded. Someone else could probably come up with a much better PHP solution using a template.
__________________
My Montezuma-themed sites: ESHS Girls Basketball Team, Venice Hongwanji Buddhist Temple
Please consider making a donation to BytesForAll for their great themes!
  #6  
Old Jun 14, 2013, 07:32 PM
juggledad's Avatar
juggledad
 
23,626 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
You can do this by
1) instaling the plugin 'exec php'
2) adding a dynamic sidebar to the header.php
3) replacing the 'bfa_excerpt()' line in 'postformat.php' with another dynamic sidebar
4) add a text widget to both new widget areas
5) add a global counter to the header widget and set it to zero
6) in the other widget, based on the counter call the_content() or the_excerpt()
  #7  
Old Jun 16, 2013, 06:09 AM
Fux
 
142 posts · Apr 2009
Thank you and wow - that sounds complicated. I didn't realize it would be that sophisticated, given it is a "simple" option in Atahualpa.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot display full posts on homepage and can't change excerpts length ute Excerpts, Read more, Pagination 7 Apr 26, 2011 03:41 PM
How to display excerpts on widget and not on center posts colums? Antoine Sidebars & Widgets 1 Nov 1, 2010 11:26 PM
Static front page - can display posts but want excerpts Mikef Atahualpa 3 Wordpress theme 7 Jun 18, 2010 11:36 AM
How do I display posts excerpts from specific categories on the homepage? aeerol Center area post/pages 0 Jun 12, 2010 04:32 PM
Too many stickies paulae New Versions, & Updating 1 May 21, 2010 02:13 PM


All times are GMT -6. The time now is 06:26 AM.


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