• Resolved turnis

    (@turnis)


    Hi there πŸ™‚

    Could you please embed the possibility to configure the default layout, overlap, margins, etc. for pages and posts (separately) into the Customizer? Currently there are only “Search Results” and “Not Found”.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hi πŸ™‚

    Thanks for posting.

    Page settings for single pages and posts should be configured within those pages or posts edited from Pages or Posts in the main WordPress menu.

    Page Template Settings handles archive pages. The settings panel will be shown once you browse to the archive page you’d like to edit in the Customizer. So for example, go to Customize > Page Template Settings and use your website’s menu to browse to your Blog or perhaps a blog category, the settings panel for that page will be shown on the left.

    Documentation on Page Settings (posts and pages):
    https://siteorigin.com/corp-documentation/page-settings/

    Documentation on Page Template Settings (blog, archives etc):
    https://siteorigin.com/corp-documentation/page-template-settings/

    404 and Search Results are always shown because it isn’t possible to browse to those pages in the Customizer.

    Hope that helps.

    Thread Starter turnis

    (@turnis)

    Thanks for your reply!

    So if I understand it correctly there is no way to set a default (no sidebar) for pages and posts globally?

    Unfortunately, not at this stage.

    In the case of the sidebar, you could set display conditions using Jetpack Widget Visibility. If the sidebar has no active widgets for a given post or page, it won’t display. Put another way, if all widgets are set to not display in a given situation, the sidebar or footer widget area wouldn’t display.

    Thread Starter turnis

    (@turnis)

    Thanks for the clarification.

    I like this theme very much, it’s the default for my clients. Please consider implementing this feature. πŸ™‚

    For sure. Thanks for your support. Alex will take a look shortly to see if you can set defaults with a custom function, we’ll come back to you πŸ™‚

    Hi turnis,

    You can change the default page settings values by filtering the siteorigin_page_settings_defaults filter. Here’s the default page settings in SiteOrigin Corp.

    For example, If I wanted to have the Header Margin and Footer Margin disabled by default, I would use the following PHP:

    function siteorigin_corp_alter_page_setting_defaults( $defaults, $type, $id ) {
    	$defaults['header_margin']  = false;
    	$defaults['footer_margin']  = false;
    
    	return $defaults;
    }
    add_filter( 'siteorigin_page_settings_defaults', 'siteorigin_corp_alter_page_setting_defaults', 15, 3 );
    Thread Starter turnis

    (@turnis)

    It seems like “page_settings.php” cannot be safely overridden by a child theme.
    So how can I apply these changes permanently?

    Hi πŸ™‚ Did you try the above function Alex sent in your child theme functions.php file?

    Thread Starter turnis

    (@turnis)

    I tried it directly but it broke the site but now with Code Snippets it works. Thanks! πŸ™‚
    However I don’t know with what to replace “default” $defaults['layout'] = 'default'; “no sidebar” didn’t work. It’s not as easy as “true” or “false”.

    Thread Starter turnis

    (@turnis)

    Very nice!

    Can we somehow separate the altered page defaults from the blog post defaults?

    Hi, you can try experimenting with:

    function siteorigin_corp_alter_page_setting_defaults( $defaults, $type, $id ) {
    
    	if ( is_admin() && function_exists( 'get_current_screen' ) ) {
    		$screen = get_current_screen();
    		$pt = get_current_screen()->post_type;
    		if ( $pt == 'post' ) {
    			$defaults['header_margin'] = true;
    		} elseif ( $pt == 'page' ) {
    			$defaults['header_margin'] = false;
    		}
    	}
    
    	return $defaults;
    }
    add_filter( 'siteorigin_page_settings_defaults', 'siteorigin_corp_alter_page_setting_defaults', 15, 3 );

    References:
    https://codex.wordpress.org/Function_Reference/get_current_screen
    https://wordpress.stackexchange.com/questions/125692/how-to-know-if-admin-is-in-edit-page-or-post

    • This reply was modified 5 years, 4 months ago by Andrew Misplon. Reason: Added is_admin conditional
Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Page Template Settings’ is closed to new replies.