Support » Plugin: Genesis Layout Extras - Default Layouts in Genesis for WordPress » New registered layout not in dropdown menu

  • Resolved Seth_Resler

    (@seth_resler)


    I’ve registered a new layout in Genesis by adding the following to my functions.php file:

    //** Add sidebar-alt-content layout **//
    genesis_register_layout( 'sidebar-alt-content', array(
        'label' => 'Small Sidebar/Content',
        'img' => '/wp-content/themes/genesis/images/sidebar-alt-content.jpg',
    ) );
    
    add_action('genesis_before', 'gt_new_custom_layout_logic');
    function gt_new_custom_layout_logic() {
    
        $site_layout = genesis_site_layout();
    
        if ( $site_layout == 'sidebar-alt-content.jpg' ) {
                    // Remove default genesis sidebars
            remove_action( 'genesis_after_content', 'genesis_get_sidebar' );
            remove_action( 'genesis_after_content_sidebar_wrap', 'genesis_get_sidebar_alt');
            add_action( 'genesis_before_content_sidebar_wrap', 'genesis_get_sidebar_alt' );
    
        }
    }

    The new layout shows up in the admin sections of all my posts and pages, but not in the dropdowm menus for your plugin. How do I get it to show up there, too? Thanks!

    http://wordpress.org/extend/plugins/genesis-layout-extras/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author David Decker

    (@daveshine)

    @seth_resler:
    Hi there!
    Thanks for your feedback!

    This is the first request of this kind. Currently it’s just not possible with my plugin.

    With the next plugin update I am considering to add a filter for the layout drop down fields so users could add custom layouts. I hope it’s possible and testing will bring good results.

    In the meantime you just could add code snippets with the conditionals to your functions.php or a functionality plugin.

    I hope that helps for now.
    Thanks, Dave 🙂

    Thread Starter Seth_Resler

    (@seth_resler)

    Hi Dave,

    Thanks for the response. I’ve already added the custom layout to the functions.php file, and it’s working on my posts and pages. It just isn’t showing up in your plugin’s dropdown menu. Is there a snippet of php I could add to the functions file to make it show up? How does your plugin decide which layouts display in the menu?

    Thanks! -Seth

    Plugin Author David Decker

    (@daveshine)

    Hi Seth!
    Thanks! As I said before, it’s currently just not possible, as the drop down function in my plugin lists all 6 layouts. And custom ones cannot be added (or removed) from that function up to now! I am thinking about of checking registered layouts and only make those registered available in the drop down. I’ve yet to check if I can add custom ones here (in general it should be possible, but I have to take care of a few other things in my plugin).

    I am considering to add such an improvement to the next major update if my testing brings good results.

    In the meantime you have to do conditional tweaks with your custom layout via own custom function(s). I could assist you with that if needed.

    I mean such things:

    if content archive/ situation x, do that custom layout, else, do some other stuff…

    –> I meant that kind of functions. The other stuff you wrote I got 🙂

    As I currently switching the plugin internally to the Genesis admin class and adding a few other user requests, I just cannot say when the update is ready. I am planning for an end of May/ beginning of June release, hopefully.

    In general, your suggestion to make the drop down filterable is a real good one, of course! 🙂

    Thanks again, Dave 🙂

    Thread Starter Seth_Resler

    (@seth_resler)

    Got it, thanks for the detailed reply! Love the plugin, keep it up!

    -Seth

    Plugin Author David Decker

    (@daveshine)

    Hi Seth!

    Just to inform you that all of my refactoring and improving the plugin is finally done! 🙂

    Oh yeah, version 2.0.0 is only a few hours before its release — it will add the possibility to add custom layouts to the drop down select menu in the admin, via a hook/helper function.

    Also, it brings up to nine (9!) optional, alternate layout options.

    And finally, one can also enable post type support for inpost layout metabox and also the new archive settings for post types.

    I hope you like it 🙂

    I notify when the new version is live.

    Thanks, Dave 🙂

    Plugin Author David Decker

    (@daveshine)

    Hi again, Seth!

    So, the big update for version 2.0.0 is now live, oh yeah! 🙂

    http://wordpress.org/plugins/genesis-layout-extras/

    It includes new alternate layout options such as “Content/Sidebar-Alt” etc. as well as improved post type support.

    Hope you like it.

    Thanks, Dave 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘New registered layout not in dropdown menu’ is closed to new replies.