I’m trying to give all “posts” title in a specific page. So If someone clicks on that posts, it’s content must be toggle below the title and if some clicks the title again then the content must hide.
I solved half of the problem with the help of WP-Archives Plugin. And my page is looking like this Check this image here.. So these are
“Archives” titles links. And if someone clicks on it, it will take to the that.. I want the content in the particular posts to be in the same page in the form of toggle (in abvoe image..). Is it possible?
It sounds like you’re describing an accordion function. WordPress offers a bunch of accordion plugins. Here are a few:
http://wordpress.org/plugins/tags/accordion
If you’re looking for something with a little more control you might want to look straight into the jquery accordion widget. See information here: http://jqueryui.com/accordion/
EDIT
To add the accordion plugin to your list, you’ll need to apply the following changes. Add the following to your head tag:
In your wp-archives plugin modify the following line:
to this:
As for the content that should follow each post title, You will need to update the plugin once again to include the archive post content(either the entire post or a snippet, whichever you choose). It should look something like this if the database field holding the content were named “post_content”.
This is possible with an accordion script like jQueryUI Accordion, but if you want to apply this to your posts page, you will also have to edit your page template.
Here is one simple method (see source):
1) Add the following to your theme’s functions.php
2) Create acc.js in your themes directory thus:
3) Finally modify your theme page to something like this:
Depending on your wordpress template this may be more complicated to implement than is outlined above… in which case you’d have to provide more information.
Another alternative would be to use some sort of plugin specifically designed for this purpose. I found three that might work for you, but they do not seem to be well supported/maintained… so the above method may still be your best option:
Collapse-O-Matic Plugin for wordpress is another alternative for this which is working like a charm for my website but only if I’m changing it to default theme of WordPress :(. Seems like there is any glitch in my theme. Anyways, thanks for all the responses posted above.