Read more ';
}
// add_filter('excerpt_more', 'new_excerpt_more');
/**
* Custome Lenght of excerpt
*/
// function custom_excerpt_length( $length ) {
// return 50;
// }
// add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
/**
* Numbered Pagination
*/
function pagination($pages = '', $range = 4)
{
$showitems = ($range * 2) + 1;
global $paged;
if (empty($paged)) $paged = 1;
if ($pages == '') {
global $wp_query;
$pages = $wp_query->max_num_pages;
if (!$pages) {
$pages = 1;
}
}
if (1 != $pages) {
echo "
\n";
}
}
/**
* stop wp removing div tags
*/
function tinymce_settings($settings)
{
// html elements being stripped
$settings['extended_valid_elements'] = 'div[*],article[*]';
// only html elements to keep
//$settings['valid_elements'] = 'a,strong/b,div,h1,h2,h3,section';
// paste elements to keep
//$opts = '*[*]';
//$settings['paste_word_valid_elements'] = $opts;
// don't remove line breaks
//$settings['remove_linebreaks'] = false;
$settings['allow_html_in_named_anchor'] = true;
// convert newline characters to BR
//$settings['convert_newlines_to_brs'] = true;
// don't remove redundant BR
//$settings['remove_redundant_brs'] = false;
// only html elements to keep
//$settings['wpautop'] = false;
// pass back to wordpress
return $settings;
}
// add_filter( 'tiny_mce_before_init', 'tinymce_settings' );
// Removing the Editor from a WordPress Post Type
// add_action('init', function () {
// remove_post_type_support('faculty', 'editor');
// }, 99);
function prefix_disable_gutenberg($current_status, $post_type)
{
if ($post_type === 'news' || $post_type === 'event' || $post_type === 'success_story' || $post_type === 'alumni' || $post_type === 'notice') return false;
return $current_status;
}
add_filter('use_block_editor_for_post_type', 'prefix_disable_gutenberg', 10, 2);
function gs_custom_menu_order($menu_ord)
{
if (!$menu_ord) return true;
return array(
'index.php',
// 'separator1',
'edit.php?post_type=page',
'edit.php',
'upload.php',
'edit-comments.php',
'separator1',
);
/* -- DEFAULTS -- */
/*
return array(
'index.php',
'separator1',
'edit.php?post_type=page',
'edit.php',
'edit.php?post_type=[your_post_type_slug]',
'upload.php',
'link-manager.php',
'edit-comments.php',
'separator2',
'themes.php',
'plugins.php',
'users.php',
'tools.php',
'options-general.php'
);
*/
}
add_filter('custom_menu_order', 'gs_custom_menu_order');
add_filter('menu_order', 'gs_custom_menu_order');