First let's make sure HB is updated. Open up terminal for the following steps.
$ brew update
| <?php | |
| $user_id = 1; | |
| $custom_post_type = 'my_post_type'; | |
| function prefix_reset_metabox_positions(){ | |
| delete_user_meta( $user_id, 'meta-box-order_post' ); // Posts | |
| delete_user_meta( $user_id, 'meta-box-order_page' ); // Pages | |
| delete_user_meta( $user_id, 'meta-box-order_' . $custom_post_type ); // Custom post types | |
| } | |
| add_action( 'admin_init', 'prefix_reset_metabox_positions' ); |
| # Change post_type value if targeting 'page' or a custom post type | |
| # Change ALL posts status from 'publish' to 'draft' | |
| UPDATE wp_posts SET post_status = 'publish' WHERE (post_type = 'post' and post_status = 'draft') |
First let's make sure HB is updated. Open up terminal for the following steps.
$ brew update
| <?php | |
| function themename_customize_register($wp_customize) | |
| { | |
| $wp_customize->add_section('themename_color_scheme', array( | |
| 'title' => __('Color Scheme', 'themename'), | |
| 'priority' => 120 | |
| )); |
| (function() { | |
| var touchingCarousel = false, | |
| touchStartCoords; | |
| document.body.addEventListener('touchstart', function(e) { | |
| if (e.target.closest('.flickity-slider')) { | |
| touchingCarousel = true; | |
| } else { | |
| touchingCarousel = false; | |
| return; |
| <?php | |
| class BlockHelper | |
| { | |
| public function getBlockFromPage(string $block_name, int $post_id) | |
| { | |
| $post = get_post($post_id); | |
| if (!$post) return false; | |
| $blocks = parse_blocks($post->post_content); |
| #301 Redirects for .htaccess | |
| #Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| #Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |
| <?php | |
| /** | |
| * Infinite next and previous post looping in WordPress | |
| */ | |
| if( get_adjacent_post(false, '', true) ) { | |
| previous_post_link('%link', '← Previous Post'); | |
| } else { | |
| $first = new WP_Query('posts_per_page=1&order=DESC'); $first->the_post(); | |
| echo '<a href="' . get_permalink() . '">← Previous Post</a>'; | |
| wp_reset_query(); |