Community Forums › Forums › Archived Forums › Design Tips and Tricks › Removing Registered Layouts
- This topic has 6 replies, 2 voices, and was last updated 8 years, 9 months ago by Dave Navarro, Jr..
-
AuthorPosts
-
June 22, 2015 at 7:12 pm #157249Dave Navarro, Jr.Member
I tried the code from:
http://my.studiopress.com/snippets/admin-management/
To unregister layouts we don't use on our site, but I get "Undefined function genesis_unregister_layout()" errors.
I am using the latest release version of Genesis with the Dynamik Web Builder child-theme and I placed the test code in my functions.php
Was that function removed from Genesis?
Dave Navarro, Jr. ~ Lead Web Developer ~ Topeka & Shawnee County Public Library
http://tscpl.orgJune 23, 2015 at 4:50 am #157270SavvyJackieMemberHi Dave,
Is this the format you are using in your functions.php file?https://gist.github.com/studiopress/5700110#file-unregister-layout-settings-php
Web Designer and Developer at Savvy Jackie Designs | Lucky with plants | @SavvyJackie
Got your question answered here? Please pay it forward by helping someone else. I’m sure there is at least one question you can answer. 🙂
June 23, 2015 at 12:53 pm #157320Dave Navarro, Jr.MemberThis is what I have right now:
// Unregister sidebar/content layout setting if ( function_exists('genesis_unregister_layout') ) { genesis_unregister_layout( 'sidebar-content' ); genesis_unregister_layout( 'content-sidebar-sidebar' ); genesis_unregister_layout( 'sidebar-sidebar-content' ); genesis_unregister_layout( 'sidebar-content-sidebar' ); }
The function genesis_unregister_layout() does not exist at the time this code runs in my functions.php
I know that the code in functions.php is running because I have other test code that does execute.
At the suggestion of StudioPress support, I am re-installing the latest release of Genesis.
Dave Navarro, Jr. ~ Lead Web Developer ~ Topeka & Shawnee County Public Library
http://tscpl.orgJune 23, 2015 at 12:58 pm #157323Dave Navarro, Jr.MemberJust downloaded and installed the latest release and still no go.
Dave Navarro, Jr. ~ Lead Web Developer ~ Topeka & Shawnee County Public Library
http://tscpl.orgJune 23, 2015 at 1:16 pm #157325SavvyJackieMemberHi,
I would try deactivating the Dynamik Web Builder child-theme and testing it on the Genesis Sample child theme to see if you can isolate the issue. If you still have an issue, then contact StudioPress support.
Web Designer and Developer at Savvy Jackie Designs | Lucky with plants | @SavvyJackie
Got your question answered here? Please pay it forward by helping someone else. I’m sure there is at least one question you can answer. 🙂
June 23, 2015 at 1:31 pm #157328Dave Navarro, Jr.MemberOkay, I put it into it's own stand-alone plugin and it's still not working. I'll download the sample child theme and try it with that.
The odd thing is that all of my other Genesis related code works... Just not this one function.
Dave Navarro, Jr. ~ Lead Web Developer ~ Topeka & Shawnee County Public Library
http://tscpl.orgJune 23, 2015 at 3:44 pm #157341Dave Navarro, Jr.MemberBizarrely... The issue was load order...
I added a "add_action" wrapper
add_action( 'init', function () { if ( function_exists('genesis_unregister_layout') ) { genesis_unregister_layout( 'sidebar-content' ); genesis_unregister_layout( 'content-sidebar-sidebar' ); genesis_unregister_layout( 'sidebar-sidebar-content' ); genesis_unregister_layout( 'sidebar-content-sidebar' ); } } );
And that fixed it. It's definitely something to do with DWB and load order.
Dave Navarro, Jr. ~ Lead Web Developer ~ Topeka & Shawnee County Public Library
http://tscpl.org -
AuthorPosts
- The topic ‘Removing Registered Layouts’ is closed to new replies.