You are here:
  1. Home
  2. Blog
 | 

Make Gutenberg Editor Full Width

/* make gutenberg editor full width */ function editor_full_width_gutenberg() { echo ‘<style> body.gutenberg-editor-page .editor-post-title__block, body.gutenberg-editor-page .editor-default-block-appender, body.gutenberg-editor-page .editor-block-list__block { max-width: none !important; } .block-editor__container .wp-block { max-width: none !important; } </style>’; } add_action( ‘admin_head’, ‘editor_full_width_gutenberg’ );

 | 

WordPress Custom General Options

class jtThemeAdmin { public $settings = array( array( ‘name’ => ‘jt-twitter’, ‘label’ => ‘Twitter URL’ ), array( ‘name’ => ‘jt-linkedin’, ‘label’ => ‘Linkedin URL’ ) ); public function __construct() { add_action( ‘admin_init’, array( $this, ‘register_custom_settings’ ) ); add_action( ‘admin_init’, array( $this, ‘register_setting_fields’ ) ); }…

 | 

Remove jQuery migrate if no dependencies found

function remove_jquery_migrate( $scripts ) { if ( !is_admin() && isset( $scripts->registered[‘jquery’] ) ) { $script = $scripts->registered[‘jquery’]; if ( $script->deps ) { $script->deps = array_diff( $script->deps, array( ‘jquery-migrate’ ) ); } } } add_action( ‘wp_default_scripts’, ‘remove_jquery_migrate’ );

 | 

Page # of X pagination

<div class=”pagination”> <?php previous_posts_link( ‘< Previous Page’ ); ?> <span>Page <?php echo ( get_query_var(‘paged’) ) ? get_query_var( ‘paged’ ) : 1; ?> of <?php echo ( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1; ?></span> <?php next_posts_link( ‘Next Page >’, ” ); ?> </div>

 | 

Forcing a ‘read more’ link on WordPress excerpts

add_filter( ‘excerpt_more’, function ( $more ) { return ”; } ); function custom_excerpt_filter( $text, $raw_excerpt ) { global $post; return $text . ‘… <a class=”read-more” href=”‘. get_permalink( $post->ID ) . ‘”>read more &raquo;</a>’; } add_filter( ‘wp_trim_excerpt’, ‘custom_excerpt_filter’, 10, 2 );

Follow on Instagram