Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Excerpts, Read more, Pagination (http://forum.bytesforall.com/forumdisplay.php?f=20)
-   -   Showing category archive in page (http://forum.bytesforall.com/showthread.php?t=3070)

Sakshin Aug 20, 2009 04:07 PM

Showing category archive in page
 
I'm messing up the whole wordpress formate; making for each page an unique template. Anyway, by now I stumble upon the following: I want to place an specific archive on a specific page. Seen the fact that I gave each page it's own template and made them with two columns, I cannot use the normal input fields for the text but have to write everything in the template.
This is the website: http://newspiration.com/news/
On the page you land here you'll see 3 categories dispalyed. The top one in full, the other two are excerpts.
now I want to make a link, to read more, to the archive page, where you will see the full story and belo it I hope to see the archive of the same posts in that column. http://newspiration.com/news/archive/

What do I have to enter into the template toe get the archive back below the full last post?

And to make it more difficult; if you click on an archive article, it would be nice if that specific article opens in place, with other words, that it doesn't take you to another page but opens it on the spot in between the previous and the following archive article.

I don't even know if archive is the right word; I want to display all the headlines of the previous posts.

I hope one of you wants to shed some light on my issue.

And I love Atathualpa.

Sakshin.

Flynn Aug 23, 2009 11:49 AM

If you've put

<?php
/*
Template Name: My Template Name
*/
?>

at the top of the file, and you've put the file into the root Atahualpa directory /wp-content/themes/atahualpa/..., then you should be able to use all Wordpress functions and tags inside your page template, such as http://codex.wordpress.org/Template_Tags/the_content and http://codex.wordpress.org/Template_Tags/the_excerpt

To use multiple loops see http://codex.wordpress.org/The_Loop#Multiple_Loops

To hide the post content first and open it on the same page on click, you'd need to use Javascript, i.e. jQuery

jQuery("Selector of link to be clicked to show/hide content").click(function(){
jQuery("Selector of initially hidden DIV containing the hidden/displayed content").slideToggle(300);
});

For Instance, put this somewhere into the jQuery section in js.php:

jQuery("div.post-headline a").click(function(){
jQuery("div.post-bodycopy").slideToggle(300);
});

Add a CSS Insert to initally hide the div.post-bodycopy on specific pages

body.class-of-that-page div.post-bodycopy {
display: none;
}

Sakshin Aug 30, 2009 03:50 PM

Olala, It getting there, have a look. http://newspiration.com/news/category/vip/

But If I tell wp the code below, I only get the headlines but I would like it to appear as it is now but when you click on a headline, the the full article shows in place and the other headline stay above or below the full post. Otherwise it gets confusing and there is no way to get back.

This is what I'm suppost to glue in the CSS but then I only get the headlines.

body.category-vip div.post-bodycopy {
display: none;
}

What I could do also is divide the whole pag into two equal divs and show the exerpts right and when you click on it the full article appears in the left column. In this way you also keep on overview of the rest of the articles and you can still navigate through them.

What do you recon? And how would i need to do that? :confused:

Flynn Aug 31, 2009 10:38 AM

Sorry this is a rather huge change and I cannot follow through with the full code for ajaxifying the multi post pages right now, I might be at a later time

Sakshin Aug 31, 2009 12:42 PM

Thanx anyway. I understand it's getting complicated here with java and all that.
After a long debate we want to do it differently; show the tumbnail images of the posts in the right column and on click on the image, the full post opens in the left column.

Is this easier to do Flynn?

Flynn Sep 1, 2009 04:05 AM

Displaying things on the same page without page reload requires Ajax so this is not much different. You can use a plugin to display post with an image, several users have done it and posted about it here on the forum. The links would point to the single post pages and not open on the same page.

Sakshin Sep 2, 2009 01:44 PM

But would it then be possible to keep the righthand column with only the thumbnails of the previous posts on the single post page? In this way I would create the same effect. But how do I get my righthand div to show in single posts of a specific category?

With regards, Sakshin.

Or if this is possible but getting to complicated to explain here, is there someone able to fix this in exchange for some payment? :)

Sakshin Sep 3, 2009 02:28 PM

Ok, after a very long search I came up with a solution; I installed the 'php-code-widget' and pasted the following code there;

<?php if ( is_single('category_name=vip') && in_category('vip')
) { ?>

<?php $my_query = new WP_Query('category_name=vip&showposts=18&offset=1' );
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php the_excerpt(); ?>

<?php endwhile; ?>
<?php } ?>

I also told the widget through widget logic to only show up at the singel vip and category vip pages with this code;

is_single(category-vip) && in_category('vip')

All the thumbnail images that I gave as excerpts showed up nicely and they linked nicely to the single posts, but just when I was about to blow the trumpet, they all disapeared again. Foetsy, gone.

Can anybody tell me if there is something wrong with the above code?


All times are GMT -6. The time now is 06:29 PM.

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