Alter Mobile Layout ( Content / Sidebar )

This is a Developer Level doc.

If you're unfamiliar with PHP and/or editing files, codes and templates, as well as with resolving possible conflict, please seek help from a professional. Under our Support Policy, we don't provide support for modifications and customization.

/**
 * Alter Mobile Layout Order
 *
 * Replace is_singular( 'cpt-type' ) with the corresponding conditional.
 * Default layout order set in the Customizer, depending on page / post type.
 * @return content-sidebar, sidebar-content
 *
 */
function my_mobile_order( $order ) {

	if ( is_singular( 'cpt-type' ) ) {

		$order = 'content-sidebar';
	}

	return $order;
}

add_filter( 'ocean_sidebar_order', 'my_mobile_order' );

Adjust the is_singular( 'cpt-type' ) and $order values per your need.

All PHP snippets should be added via a child theme's functions.php file.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.