Adds URL to pages window

add_filter(‘manage_page_posts_columns’, ‘my_custom_column’, 10); add_action(‘manage_page_posts_custom_column’, ‘add_my_custom_column’, 10, 2); function my_custom_column($defaults) { $defaults[‘url’] = ‘URL’; return $defaults; } function add_my_custom_column($column_name, $post_id) { if ($column_name == ‘url’) { $siteURL=get_site_url($post_id); $link= get_permalink( $post_id ); echo str_replace($siteURL,””,$link); } }Continue reading

Add Theme colors to Head

$themecolors = get_option(‘cornerstone_color_items’); if($themecolors) { $css = ‘ ‘; function colors_css() { global $css; echo $css; } add_action(‘wp_head’, ‘colors_css’); }Continue reading

Shortcode for Comma-Separated List Parsing and Grouping

function formidable_shortcode_list_view($atts) { global $wpdb; // Shortcode attributes $atts = shortcode_atts(array( ‘field_id’ => ”, ), $atts, ‘formidable_list_view’); if (empty($atts[‘field_id’])) { return ‘Field ID is required.’; } // Get all entries $entries = $wpdb->get_results( $wpdb->prepare( “SELECT meta_value FROM {$wpdb->prefix}frm_item_metas WHERE field_id…Continue reading

add post formats

// available formats: // aside, gallery, link, image, quote, status, video, audio, chat function theme_post_formats_setup() { add_theme_support( ‘post-formats’, array( ‘quote’, ‘image’, ‘link’, ‘gallery’, ‘status’, ‘aside’, ‘chat’ ) ); } add_action( ‘after_setup_theme’, ‘theme_post_formats_setup’ ); // If using a child theme add_action(…Continue reading

Bootstrap 5

// Add custom scripts function add_custom_script_bootstrap5() { wp_register_script( ‘bootstrap5_js’, ‘https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.min.js’, array(), ‘5.3.3’, true ); wp_enqueue_script( ‘bootstrap5_js’ ); wp_register_style( ‘bootstrap5_css’, ‘https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/css/bootstrap.min.css’, array(), ‘5.3.3’, true ); wp_enqueue_style( ‘bootstrap5_css’ ); wp_register_style( ‘bootstrap5_css_containers’, ‘https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/scss/_containers.scss’, array(), ‘5.3.3’, true ); wp_enqueue_style( ‘bootstrap5_css_containers’ ); } add_action( ‘wp_enqueue_scripts’,…Continue reading

Allow SVG Files Upload (copy) (copy)

/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading