Community Forums › Forums › Archived Forums › Design Tips and Tricks › Adding Featured Posts widget areas to a static page
Tagged: adding widget areas, featured posts, Static Page
- This topic has 31 replies, 2 voices, and was last updated 11 years, 2 months ago by
nutsandbolts.
-
AuthorPosts
-
November 8, 2013 at 1:40 pm #71759
nutsandbolts
MemberBut what does it say is wrong? Usually you'll get something like UNEXPECTED T_STRING or something to indicate the type of PHP error.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 8, 2013 at 1:41 pm #71763Ben Siegfried
MemberParse error: syntax error, unexpected ‘;’, expecting ‘)’ in C:\Users\GRAPHICS\Documents\Websites\KPC\www.mywebsite.dev\wp-content\themes\agency-pro\functions.php on line 126
November 8, 2013 at 1:42 pm #71764nutsandbolts
MemberOkay. And what is the entire function?
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 8, 2013 at 1:44 pm #71766Ben Siegfried
Member//* Add the page widget in the content add_action( 'genesis_entry_footer', 'agency_add_page_content' ); function agency_add_page_content() { if ( is_page(94) ) genesis_widget_area( 'partial-client-list', array( 'before' => '<div id="partial-client-list">', ) ); }
November 8, 2013 at 1:48 pm #71768nutsandbolts
MemberEdited: Nope, that's not it. Hang on....
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 8, 2013 at 1:52 pm #71769Ben Siegfried
MemberTried that it's giving the same parse error of:
Parse error: syntax error, unexpected ';', expecting ')' with all the same thereafter...
November 8, 2013 at 2:00 pm #71770nutsandbolts
MemberOkay. This is exactly what I just pasted into functions.php on a test site using Agency Pro. No errors, and the widget area is functional.
//* Add the page widget in the content add_action( 'genesis_entry_footer', 'agency_add_page_content' ); function agency_add_page_content() { if ( is_page('94') ) genesis_widget_area( 'partial-client-list', array( 'before' => '<div id="partial-client-list">', ) ); } //* Register the page bottom widget area genesis_register_sidebar( array( 'id' => 'partial-client-list', 'name' => __( 'Partial Client List', 'agency' ), 'description' => __( 'This is the widget area at the bottom of a certain page.', 'agency' ), ) );
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 8, 2013 at 2:08 pm #71771Ben Siegfried
MemberOk, sweet, that worked, am able to pull in content from featured post widget to that page. I can't tell what was different, did you find it?
Thank you very much!
November 8, 2013 at 2:12 pm #71772nutsandbolts
MemberNot a clue. I just pasted what you had and altered the names in the function to match what you were using. I blame gremlins!
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 8, 2013 at 2:14 pm #71774Ben Siegfried
MemberI didn't have
('94')
I had(94)
(no quotes). Removed those to repeat error and that didn't repeat the error, oh well, I'll take the fix, a fix that works is a good fix!November 8, 2013 at 2:18 pm #71775Ben Siegfried
MemberChanged the hook to
genesis_entry_content
now that works the same. Thanks again so much for helping me with this!November 8, 2013 at 2:22 pm #71776nutsandbolts
MemberNo problem! If you don't mind, please mark this topic as resolved so we'll know you've been helped. You can always start a new topic if you have other questions. 🙂
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+ -
AuthorPosts
- The topic ‘Adding Featured Posts widget areas to a static page’ is closed to new replies.