Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Not sure if it's just this one widget in particular or if I'm doing something wrong but it seems that the Featured Post widget doesn't call the hooks for the content. I have the widget added to my homepage widget area and I have the following code in my theme's functions:

function go_before_post() {
    echo "TESTING";
}
add_action( 'genesis_before_post_content', 'go_before_post' );

The word TESTING appears on the post's page but does not appear before the content in the featured posts widget. Taking a look at the widget source it looks like it doesn't call any hooks. Is this the case and is there any reason for that?

share|improve this question
Really? Closed as "off topic" without any comment? I'm curious as to what makes this question be considered off topic. I read through the FAQ and can't find any relevant reason. Maybe I wasn't clear enough in the question or there is something that needs clarification? – mattedgod Jan 22 at 6:16
Well since this was closed and I can't answer the question anymore here is where to look, got this from the support team at StudioPress: wordpress.org/extend/plugins/genesis-featured-widget-amplified – mattedgod Jan 22 at 16:02
It was closed as we can't look at the Widget code. How should one get around a problem without knowing the source of it? Is the linked plugin the one in question? If so, you'll get my reopen vote. – kaiser Jan 23 at 18:34
@kaiser I acknowledge the fact that only Genesis customers will have access to the widget in question. The linked widget in the comment is an open-source alternative that solves the problem with the Genesis widget that I have asked about. My beef with the closing was simply that it got closed and I have no idea why. The FAQ does not reference commercial software at all so you can understand my confusion. I understand now that there are discussions happening in meta about what to do in these situations. – mattedgod Jan 23 at 18:46
It's not only this issue. We simply can't look at the source and guessing around won't solve this in a manner that it would be useful for later readers, which is the final goal of the site. – kaiser Jan 23 at 19:11
show 1 more comment

closed as off topic by Wyck, brasofilo, Chip Bennett, toscho Jan 22 at 4:07

Questions on WordPress Answers are expected to relate to WordPress within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

Not exactly sure what you mean here but try this.

add_action( 'genesis_before_sidebar_widget_area', 'go_before_post' );

function go_before_post() {
echo "TESTING";

}

Your home page may be different but the above will show "TESTING" above the sidebar on pages and posts. Genesis provides lots of hooks, here is a visual reference.

Source

share|improve this answer
The Featured Post widget in particular loops through the featured posts and displays them. This code will print TESTING before the widget itself but I would like to put something before each piece of content inside of the widget. In other words, the widget displays content but does not call the content hooks on the page you referenced. – mattedgod Jan 22 at 3:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.