Using the [suffusion-widgets id='1'] shortcode on all posts

General questions pertaining to how certain issues can be resolved. This forum is closed with effect from February 2019. Please post future requests on https://github.com/sayontan/suffusion.
Forum rules
This forum is closed with effect from February 2019. Please post future requests on https://github.com/sayontan/suffusion.

1. No offensive language and no mocking
2. Please do a thorough search before you post something. Trust us, there is a high probability that the question you are asking has been asked previously.
3. No soliciting. You cannot post here soliciting bids for people offer you quotes, or even offer money to people for some work. You will be moderated if you do so. If you are looking for help, please post your request on http://jobs.wordpress.net or http://codepoet.com
4. Please be reasonable. You are getting software and support. For free. Complicated requests from a general purpose theme are not welcome and some volunteers might lose patience with you.
5. Please do your due diligence. If you posted a query and we answered with a link, take the trouble to go through the link contents.
6. Please post with complete information. Requests for help MUST be accompanied with your URL, particularly if you are asking something like "Why am I seeing a blank space?"
Locked
JasonSB
Posts: 11
Joined: 25 May 2010, 16:12

Using the [suffusion-widgets id='1'] shortcode on all posts

Post by JasonSB » 11 Aug 2010, 16:58

Is it possible to have the ad hoc widget shortcode show up in all past posts instead of adding it manually?

I saw this while looking for a solution http://michaeldozark.wordpress.com/2010 ... plate-tag/

I'd like to add an 'related posts' and 'recent posts' ad hoc shortcode under all previous and future posts, for example.

sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Re: Using the [suffusion-widgets id='1'] shortcode on all po

Post by sayontan » 11 Aug 2010, 17:03

Your link is not connected to the ad hoc sidebar short code in any way. For what you are asking you will first have to develop the code to print the recent posts etc. Of course, if you are doing that you might as well use the correct way to include that at the end of each post, but adding it through an action hook or a filter hook. That begs the question, why don't you use a plugin for this?

JasonSB
Posts: 11
Joined: 25 May 2010, 16:12

Re: Using the [suffusion-widgets id='1'] shortcode on all po

Post by JasonSB » 11 Aug 2010, 18:14

I have been unable to find any plugins that put recent posts under the post content that are for wordpress 3.0 +.

I'm asking because it seems like a simple way to add a recent posts/related posts.. possibly a social sharing widget under every single post.

If you could point me in the right direction with the filter and hooks I'd appreciate it.

I also wanted to do it using your shortcodes so all the widgets below the post had a similar format.

When I add the recent posts to a post using ad hoc it's not in the same position or size as the related post plugin I use. So it looks sloppy.

Have you considered a 'widget area below post content' widget area?

sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Re: Using the [suffusion-widgets id='1'] shortcode on all po

Post by sayontan » 11 Aug 2010, 18:28

For hooks:
1. Create a child theme.
2. Create a functions.php file in the child theme.
3. Within the <?php and ?> tags add this:

Code: Select all

add_action('suffusion_before_end_post', 'your_custom_function_name');
function your_custom_function_name() {
    // Put in the code to determine your recent posts
}
For further documentation about hooks look into the WordPress Codex.

JasonSB
Posts: 11
Joined: 25 May 2010, 16:12

Re: Using the [suffusion-widgets id='1'] shortcode on all po

Post by JasonSB » 11 Aug 2010, 18:31

I'll give that a try.

Thank you, Sayontan.

Locked