Skip to content

Instantly share code, notes, and snippets.

@saltyfireball
Forked from thecodepoetry/functions.php
Created November 5, 2017 23:30
Show Gist options
  • Select an option

  • Save saltyfireball/6f6c12b31b795e49fdffc258867bb145 to your computer and use it in GitHub Desktop.

Select an option

Save saltyfireball/6f6c12b31b795e49fdffc258867bb145 to your computer and use it in GitHub Desktop.
Change sidebar position for woocommerce products for The7 -Mulltipurpose wordpress them
function change_sidebar_pos() {
$args = array (
'post_type' => 'product',
'post_per_page' => -1
);
query_posts( $args );
while ( have_posts() ) : the_post();
update_post_meta( get_the_ID(), '_dt_sidebar_position', 'left' );
endwhile;
}
add_action('admin_init', 'change_sidebar_pos');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment