I’m making a website and using wordpress as a CMS.
I have a frontpage which has some widget ready regions.
I also have several other static pages (such as ‘about me’ for example)
These pages have an excerpt (above the ‘more’ line) and a body text (under the more line).
I’ve been trying for hours but I can’t find a good plugin or some usefull code that let’s me show the excerpt of a certain page in the widget area (sidebar).
If anyone could help me, that would be awesome…
You can do this with a plugin but it might be more beneficial to implement it yourself. It’s not very complex at all. You’ll have to do two things to get a post excerpt inside of a widget. By default, WordPress doesn’t let you run php inside of a widget. To get around this, go into your
functions.php
file and add the following code at the bottom of the file:This allows you to run php code inside widgets. With that in place, go to your widgets menu and drag a new text box to the sidebar and place the following code into the text box:
This code will go through and output the except for the first five posts in category 11. You can obviously modify the code to get whatever particular result you are looking for. Let me know if you need the code tailored more directly to your specific case and I’ll help you out.
Try this code for excerpt..
Change the category ID and limit of post’s…
First you have to install PHP Code Widget plugin.
Drag this plug widget on the sidebar and place this code there
Hope this will help