SCRAWL Editor
Member
Posted 3 years ago #
Destructoid has the option of using a compact view: http://www.destructoid.com/elephant/index-short.phtml?nav=compact or blog view: http://www.destructoid.com/elephant/index.phtml on their site. Of course, they're using a custom coded blog, not WordPress. But I like that feature and would like to implement the option on my blog. How exactly could I go about doing that? Is there a plugin that will allow me to give viewers a compact view if they choose?
Could do this with two different Templates, one displaying posts using template tag, the_excerpt(), for a compact view, and the other using the template tag, the_content(), for blog view.
You'll also want to create a Page Template and assign it to the Compact View Page and put a query_posts loop in that template file.
SCRAWL Editor
Member
Posted 3 years ago #
I'm not quite sure I understand the query_posts loop thing. Could you explain?
Use query_posts to retrieve the posts and display them in a loop.
SCRAWL Editor
Member
Posted 3 years ago #
Hmm, is there anyway to add the title IN the excerpt? I'm using a plugin to display an excerpt image to the left of the excerpt, and I kind of want the title INSIDE the excerpt.
SCRAWL Editor
Member
Posted 3 years ago #
Also, I created a template file named condensed.php with my compact blog view located within it. But how would I be able to allow users to select between the two views?
SCRAWL Editor
Member
Posted 3 years ago #
Can't answer the title in excerpt except to consider using the_title template tag.
If you create Pages then use template tag, wp_list_pages(), in a sidebar.php or header.php to display links to Pages.
Or use the new template tag, wp_page_menu().
**Please refrain from bumping as per Forum Rules
SCRAWL Editor
Member
Posted 3 years ago #
Sorry about the bump.
That's not what I mean though. I know how to get the link in my Navigation bar, but I have the file /themename/condensed.php and I want users to be able to select between Blog View and Compact View, and when in Compact View, be able to switch back, etc.
How would I link to condensed.php to begin with though?
Create a Page called Compact View and a Page called Blog View.
Do you see those in your nav bar?