Skip to content

Instantly share code, notes, and snippets.

@thecodepoetry
Created May 22, 2014 17:12
Show Gist options
  • Save thecodepoetry/e5bb6f6a0e014ae450f1 to your computer and use it in GitHub Desktop.
Save thecodepoetry/e5bb6f6a0e014ae450f1 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');
@nicolabavaro
Copy link

Still valid! Thanks!

@davelln
Copy link

davelln commented Nov 30, 2020

hi there, it is not working for me :S can you help me in 2020? ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment