OK – so this is a first stab at working out what is the best way to put these together –
URL / Start Off
Finding Domains::
https://domainwheel.com/
Could be a fun tool to set it all up with –
Hosting
bluehost.com
Themes
Terms/Technology Explained
If there were some terms/technology mentioned in the post above that you did not understand, refer here for answers.
Sass
Sass is an extension of tradional CSS that adds extra functionality to it. The sass files will be compiled into normal CSS, so it is supported by all browsers. In it you can use things like functions, variables and mixins, things that are not available in CSS, but are very useful for development.
You can also create separate files for styling separate sections/page templates. This makes your CSS a lot easier to stay on top of, without it affecting performance. (Because you compile it into one CSS file.)
You can read about sass basics here.
Gulp
Gulp is a task runner, a system that helps you automate tasks like compiling Sass into CSS, minify JS files, refresh browser windows upon changes and even automatically optimize images.
To install gulp you need to have NodeJS installed.
npm
npm is node.js’s package manager. It makes adding JS or CSS libraries super easy and super fast for example.
To install npm you need to have NodeJS installed.
Element
An element is basically a part of a HTML webpage. If you look at the source code for this page, you will see elements like
and , these house the header, blog posts and widgets respectively. These elements are then styled(designed) with CSS.
Bower
Bower is a package manager, which does more or less the same things as npm.
To install Bower you need to have NodeJS installed.
Schema.org Microdata
Schema.org Microdata is basically a way to give search engines like google extra information about a piece of content to display in their results. For example, you can add a google maps location and reviews for your business page to show up with your results, or prices for items if you are running a shop.
Create theme with bootstrap included::
https://www.lyrathemes.com/bootstrap-wordpress-theme-tutorial-1/
Home
Lightweight
Actively Maintained
Easy To Understand Well Commended HTML/CSS
Custom Header
Dropdown menu on phones/tables
2 CSS layouts (left/right sidebar)
Homepage
UnderStrap combines the Underscores starter theme (by Automattic) and the mobile-first, responsive grid framework Bootstrap 4 (by Twitter) into a perfect open source foundation for your next WordPress theme project.
https://roots.io/sage-should-not-be-your-first-wordpress-theme/
Bootstrap
Sass
Gulp
Bower
Active community
Home
Translation support
Actively maintained
Foundation
Sass
Gulp
Bower
Bones – An HTML5, Mobile-First starter theme for rapid WordPress development.
Responsive out of the box
Sass
Custom Post Types included
Well Documented
http://html5blank.com/
Completely blank slate
Simplistic
Fast
Frameworks
https://my.studiopress.com/themes/genesis/
Responsive out of the box
Schema.Org micro data
Easily customizable
Different layout options
Lots of specific functionality plugins
Active community
Actively maintained
Hybrid Core
Breadcrumbs
Custom Gallery
Schema.Org Microdata
Support for multiple theme layouts
Active Community
Required Plugin list
Legal Stuff::
WordPress Privacy Policy & Terms of Use Plugin – WP Legal Pages (GDPR, CCPA Compliant)
https://www.wpbeginner.com/showcase/23-top-tools-for-wordpress-freelancers-designers-and-developers/
WP Raffle
!!!!!
https://www.semrush.com/swa/
!!!! – helps write seo info
The #1 Website SEO Auditor To Boost Your Website’s Ranking
Yoast
shortcode any widget
plugin organizer
WP Rocket
https://get.nextiva.com/ – phone service
https://hunter.io/ – find contacts
INVOICING::
Homepage
https://wpforms.com/docs/create-invoice-wpforms/ – send invoices with wpforms
https://www.waveapps.com/
ORGANIZE::
https://asana.com
http://trell.com
http://basecamp.com
also http://wrike.com
INFO::
https://feedly.com/
https://textexpander.com/ – TEXT SNIPPET SAVER!!
SOCIAL MEDIA::
https://www.wpbeginner.com/refer/buffer/ – manages all social –
TOOLS::
https://photopea.com
https://www.canva.com/
https://affinity.serif.com/en-us/
http://figma.com
WRITING:
http://www.hemingwayapp.com/
EMAILS::
https://mxt.smsglobal.com/messaging/send – also set up with $5 in credits – if it ever gets approved –
https://app.sendinblue.com/ – set up with SMS credits – seeing if I can test some stuff –
Logo
Order Number: 54475
2020-02-09 04:26:30
Name: Shawn Palmer
Email: shawn@spiffydesign.com
SMS Pack (USD): USD 5.70
https://www.wpbeginner.com/refer/sendinblue/
waiting 4 hours –
Set TXT record for “shawneee.com” to
Sendinblue-code:c5baf22cca4c7fdcdd6021ccb79e8da3
Breaking up functions.php
Break up file – can use plugins (but can be harder to edit later) – OR- make includes out of parts of functions.php file –
1st breakout – has parts that I see all sites needing –
Create Include to add-on functions
[code language=”css”]
/*////////////////////////////////////////////////////////////////////
* SITE ADD-ON FUNCT ///////////////////////////////////
//////////////////////////////////////////////////////////////////////*/
require_once( __DIR__ . ‘/includes/sitename-site-functionality-inc.php’);
[/code]
Basic (feb2020) add-on set ups
[code language=”php”]
<?php
/**
* ccc-site-functionality
* http://shawneee.com
* Description: Functionality to be reused on all sites
* Version: 1.0.0
* Author: Shawneee.com
* Author URI: http://shawneee.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: plugin-name
* Domain Path: /languages
*/
/*—————————————
turn off heartbeat – may be slowing down everything in admin
/—————————————*/
/* WPRocket add_action( ‘init’, ‘stop_heartbeat’, 1 );
function stop_heartbeat() {
wp_deregister_script(‘heartbeat’);
}*/
/*—————————————
Redirect users after login
/—————————————*/
function redirect_admin( $redirect_to, $request, $user ){
//is there a user to check?
if ( isset( $user->roles ) && is_array( $user->roles ) ) {
//check for admins screen page
if ( in_array( ‘administrator’, $user->roles ) ) {
$redirect_to = WP_HOME.’/welcome-to-projects/’; // Your redirect URL
}
}
return $redirect_to;
}
add_filter( ‘login_redirect’, ‘redirect_admin’, 10, 3 );
/*————————————*
ADD ANALYTICS
*————————————*/
add_action(‘wp_head’,’ccc_analytics’, 20);
function ccc_analytics() {
?>
<!– Global site tag (gtag.js) – Google Analytics –>
<!–<script async src="https://www.googletagmanager.com/gtag/js?id=UA-6552503-1"></script> ;
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘UA-6552503-1’);
</script>–>
<?php
}
/*————————————*
ADD CATEGORIES AND TAGS TO PAGES
*————————————*/
function add_cats_and_tags_to_pages_definition() {
register_taxonomy_for_object_type(‘post_tag’, ‘page’);
register_taxonomy_for_object_type(‘category’, ‘page’);
}
add_action( ‘init’, ‘add_cats_and_tags_to_pages_definition’ );
/*—————————————
add categories to body class
/—————————————*/
add_filter(‘body_class’,’add_category_to_single’);
function add_category_to_single($classes) {
if (is_single() ) {
global $post;
foreach((get_the_category($post->ID)) as $category) {
// add category slug to the $classes array
$classes[] = $category->category_nicename;
}
}
// return the $classes array
return $classes;
}
/* add to pages */
add_filter(‘body_class’,’my_page_body_class’);
function my_page_body_class($classes) {
if (is_page() ) {
global $page;
foreach((get_the_category($page->ID)) as $category) {
// add category slug to the $classes array
$classes[] = $category->category_nicename;
}
}
// return the $classes array
return $classes;
}
/*————————————*
ADD PAGE SLUG TO BODY CLASS
*————————————*/
//Body Class for Page Slug
function add_slug_body_class( $classes ) {
if (is_single() ) {
global $post;
if ( isset( $post ) ) {
$classes[] = $post->post_type . ‘-slug-‘ . $post->post_name;
}
return $classes;
}
}
add_filter( ‘body_class’, ‘add_slug_body_class’ );
/*————————————*
ADD CATEGORIES TO IMAGES
*————————————*/
/* https://code.tutsplus.com/articles/applying-categories-tags-and-custom-taxonomies-to-media-attachments–wp-32319 */
function wptp_add_categories_to_attachments() {
register_taxonomy_for_object_type( ‘category’, ‘attachment’ );
}
add_action( ‘init’ , ‘wptp_add_categories_to_attachments’ );
// apply tags to attachments
function wptp_add_tags_to_attachments() {
register_taxonomy_for_object_type( ‘post_tag’, ‘attachment’ );
}
add_action( ‘init’ , ‘wptp_add_tags_to_attachments’ );
// register new taxonomy which applies to attachments
function wptp_add_location_taxonomy() {
$labels = array(
‘name’ => ‘Locations’,
‘singular_name’ => ‘Location’,
‘search_items’ => ‘Search Locations’,
‘all_items’ => ‘All Locations’,
‘parent_item’ => ‘Parent Location’,
‘parent_item_colon’ => ‘Parent Location:’,
‘edit_item’ => ‘Edit Location’,
‘update_item’ => ‘Update Location’,
‘add_new_item’ => ‘Add New Location’,
‘new_item_name’ => ‘New Location Name’,
‘menu_name’ => ‘Location’,
);
$args = array(
‘labels’ => $labels,
‘hierarchical’ => true,
‘query_var’ => ‘true’,
‘rewrite’ => ‘true’,
‘show_admin_column’ => ‘true’,
);
register_taxonomy( ‘location’, ‘attachment’, $args );
}
add_action( ‘init’, ‘wptp_add_location_taxonomy’ );
/*————————————*
adding excerpt to pages
*————————————*/
add_post_type_support( ‘page’, ‘excerpt’ );
/*
function new_excerpt_more( $more ) {
return ‘ <a class="read-more" href="’. get_permalink( get_the_ID() ) . ‘">Read More</a>’;
}
add_filter( ‘excerpt_more’, ‘new_excerpt_more’ );
*/
/*————————————*
ADD BODY CLASSES TO ADMIN
*————————————*/
add_filter( ‘admin_body_class’, ‘rw_admin_body_class’ );
function rw_admin_body_class( $classes )
{
$screen = get_current_screen();
if ( ‘post’ == $screen->base )
$classes .= ‘ ‘ . $screen->post_type;
return $classes;
}
/*————————————*
FAVICONS TO OUTER SITE
*————————————*/
add_action(‘wp_head’,’shawneee_favicons’, 20);
function shawneee_favicons() {
?>
<!– shawneee favicons –>
<link rel="apple-touch-icon" sizes="180×180" href="/the/wp-content/themes/astra-child/favicon_package/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32×32" href="/the/wp-content/themes/astra-child/favicon_package/favicon-32×32.png">
<link rel="icon" type="image/png" sizes="16×16" href="/the/wp-content/themes/astra-child/favicon_package/favicon-16×16.png">
<link rel="manifest" href="/the/wp-content/themes/astra-child/favicon_package/site.webmanifest">
<link rel="mask-icon" href="/the/wp-content/themes/astra-child/favicon_package/safari-pinned-tab.svg" color="#ff6600">
<link rel="shortcut icon" href="/the/wp-content/themes/astra-child/favicon_package/favicon.ico">
<meta name="msapplication-TileColor" content="#ff6600">
<meta name="msapplication-config" content="/the/wp-content/themes/astra-child/favicon_package/browserconfig.xml">
<meta name="theme-color" content="#ff6600">
<?php
}
/*————————————*
FAVICON FOR ADMIN
*————————————*/
function favicon4admin() {
echo ‘<link rel="Shortcut Icon" type="image/x-icon" href="’ . get_bloginfo(‘wpurl’) . ‘/wp-content/themes/astra-child/faviconpackage/admin_favicon.ico" />’;
}
add_action( ‘admin_head’, ‘favicon4admin’ );
/*————————————*
FORCE NORMAL NON CURLY QUOTES
*————————————*/
/*
Use normal quotes instead of curly quotes
If you have ever shared a code snippet on WordPress, you might have noted that by default, WP turns normal quotes to smart codes, which could break the code snippet you’re about to publish.
*/
remove_filter(‘the_content’, ‘wptexturize’);
/*————————————*
REMOVE STUFF FROM HEADER
*————————————*/
// remove junk from head
remove_action(‘wp_head’, ‘rsd_link’);
remove_action(‘wp_head’, ‘wp_generator’);
remove_action(‘wp_head’, ‘feed_links’, 2);
remove_action(‘wp_head’, ‘index_rel_link’);
remove_action(‘wp_head’, ‘wlwmanifest_link’);
remove_action(‘wp_head’, ‘feed_links_extra’, 3);
remove_action(‘wp_head’, ‘start_post_rel_link’, 10, 0);
remove_action(‘wp_head’, ‘parent_post_rel_link’, 10, 0);
remove_action(‘wp_head’, ‘adjacent_posts_rel_link’, 10, 0);
/*————————————*
make gallery default to using medium size images
*————————————*/
/* Register shortcode_atts_gallery filter callback */
add_filter( ‘shortcode_atts_gallery’, ‘meks_gallery_atts’, 10, 3 );
/* Change attributes of wp gallery to modify image sizes for your needs */
function meks_gallery_atts( $output, $pairs, $atts ) {
/* You can use these sizes:
– thumbnail
– medium
– large
– full
or, if your theme/plugin generate additional custom sizes you can use them as well
*/
$output[‘size’] = ‘medium’; //i.e. This will change all your gallery images to "medium" size
return $output;
}
/*————————————*
stop the p in all post types
*————————————*/
// Prevent WP from adding <p> tags on all post types
/*function disable_wp_auto_p( $content ) {
remove_filter( ‘the_content’, ‘wpautop’ );
remove_filter( ‘the_excerpt’, ‘wpautop’ );
return $content;
}
add_filter( ‘the_content’, ‘disable_wp_auto_p’, 0 );*/
/*————————————*
MAKE BR WORK WHEN REST OF AUTOP IS OFF
*————————————*/
function clear_br($content) {
return str_replace("<br/>","<br clear=’none’/>", $content);
}
add_filter(‘the_content’,’clear_br’);
/*————————————*
Exclude tag from tag list
*————————————*/
function mytheme_filter_tags( $term_links ) {
$result = array();
$exclude_tags = array( ‘some tag’, ‘another tag’, ‘third tag’ );
foreach ( $term_links as $link ) {
foreach ( $exclude_tags as $tag ) {
if ( stripos( $link, $tag ) !== false ) continue 2;
}
$result[] = $link;
}
return $result;
}
add_filter( "term_links-post_tag", ‘mytheme_filter_tags’, 100, 1 );
// do loop stuff
echo get_the_tag_list(‘<p>Tags: ‘,’, ‘,'</p>’);
// end loop stuff
remove_filter( "term_links-post_tag", ‘mytheme_filter_tags’, 100 );
/*————————————*
SET UP NO POST CATEGORY – try to make "internal" excluded
*————————————*/
function exclude_category_posts( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( ‘cat’, ‘-1’ );
}
}
add_action( ‘pre_get_posts’, ‘exclude_category_posts’ );
/* exclude from search */
function wcs_exclude_category_search( $query ) {
if ( is_admin() || ! $query->is_main_query() )
return;
if ( $query->is_search ) {
$query->set( ‘cat’, ‘-1’ );
}
}
add_action( ‘pre_get_posts’, ‘wcs_exclude_category_search’, 1 );
/*————————————*
UPLOAD SVG
*————————————*/
/*
function cc_mime_types($mimes) {
$mimes[‘svg’] = ‘image/svg+xml’;
return $mimes;
}
add_filter(‘upload_mimes’, ‘cc_mime_types’);
*/
/*
svg files – you have to add <?xml version="1.0" encoding="utf-8"?> to the file for it to upload
*/
/*————————————*
UPLOAD / USE ANY FILE TYPE
*————————————*/
/*
Enable WordPress to Upload Any File Type You Want
By default, WordPress only enables you to upload a very limited range of file types, including common media formats such as .png and .jpg. With this code, you’ll be able to force your installation to allow more types:
*/
/*—————————————
SVG OK
/—————————————*/
/*function cc_mime_types($mimes) {
$mimes[‘svg’] = ‘image/svg+xml’;
return $mimes;
}
add_filter(‘upload_mimes’, ‘cc_mime_types’);
*/
/*————————————*
REDIRECT AUTHORS TO PAGE AS WP DEFAULT PAGE
*————————————*/
function dashboard_redirect($url) {
global $current_user;
// is there a user ?
if(is_array($user->roles)) {
// check, whether user has the author role:
if(in_array(‘author’, $current_user->roles)) {
$url = ‘edit.php?post_type=page’;
}
return $url;
}
}
add_filter(‘login_redirect’, ‘dashboard_redirect’);
/*————————————*
REMOVE DASHBOARD FROM INTERNAL WP NAV
*————————————*/
//add_action( ‘admin_menu’, ‘Wps_remove_tools’, 99 );
//function Wps_remove_tools(){
//remove_menu_page( ‘index.php’ ); //dashboard
//}
/*————————————*
NAMES OF REQUIRED DASHBOARD PLUGINS
*————————————*/
// Browser Update Required
$wp_meta_boxes[‘dashboard’][‘normal’][‘high’][‘dashboard_browser_nag’];
// PHP Update Required
$wp_meta_boxes[‘dashboard’][‘normal’][‘high’][‘dashboard_php_nag’];
// At a Glance
$wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_right_now’];
// Right Now
$wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘network_dashboard_right_now’];
// Activity
$wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_activity’];
// Site Health Status
$wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘health_check_status’];
// Side Column (right):
// WordPress Events and News
$wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_primary’];
// Quick Draft, Your Recent Drafts
$wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_quick_press’];
/*————————————*
REMOVE QUICK PRESS (SINGLE) DASHBOARD WIDGET
*————————————*/
// Create the function to use in the action hook
function wporg_remove_dashboard_widget() {
remove_meta_box( ‘dashboard_quick_press’, ‘dashboard’, ‘side’ );
}
// Hook into the ‘wp_dashboard_setup’ action to register our function
add_action( ‘wp_dashboard_setup’, ‘wporg_remove_dashboard_widget’ );
/*————————————*
REMOVE ALL STANDARD DASHBOARD WIDGETS
*————————————*/
function wporg_remove_all_dashboard_metaboxes() {
// Remove Welcome panel
remove_action( ‘welcome_panel’, ‘wp_welcome_panel’ );
// Remove the rest of the dashboard widgets
remove_meta_box( ‘dashboard_primary’, ‘dashboard’, ‘side’ );
//remove_meta_box( ‘dashboard_quick_press’, ‘dashboard’, ‘side’ );
//remove_meta_box( ‘health_check_status’, ‘dashboard’, ‘normal’ );
remove_meta_box( ‘dashboard_right_now’, ‘dashboard’, ‘normal’ );
remove_meta_box( ‘dashboard_activity’, ‘dashboard’, ‘normal’);
}
add_action( ‘wp_dashboard_setup’, ‘wporg_remove_all_dashboard_metaboxes’ );
/*————————————*
REMOVE ADDITIONAL DASHBOARD WIDGETS
*————————————*/
function wporg_remove_all_dashboard_addon_metaboxes() {
// Remove Welcome panel
//remove_action( ‘welcome_panel’, ‘wp_welcome_panel’ );
// Remove the rest of the dashboard widgets
//remove_meta_box( ‘dashboard_primary’, ‘dashboard’, ‘side’ );
//remove_meta_box( ‘dashboard_quick_press’, ‘dashboard’, ‘side’ );
remove_meta_box( ‘wpforms_reports_widget_lite’, ‘dashboard’, ‘normal’ );
remove_meta_box( ‘e-dashboard-overview’, ‘dashboard’, ‘normal’ );
remove_meta_box( ‘tribe_dashboard_widget’, ‘dashboard’, ‘normal’);
remove_meta_box( ‘postbox-container-1’, ‘dashboard’, ‘normal’ );
remove_meta_box( ‘dashboard_widget’, ‘dashboard’, ‘normal’ );
}
add_action( ‘wp_dashboard_setup’, ‘wporg_remove_all_dashboard_addon_metaboxes’ );
//wpforms_reports_widget_lite
/*————————————*
ADD CUSTOM WIDGETS TO DASHBOARD (ADMIN)
*————————————*/
/*
You probably have seen widgets that numerous plugins and themes add in the WordPress dashboard. As a theme developer, you can add one yourself by pasting the following code:
*/
add_action(‘wp_dashboard_setup’, ‘my_custom_dashboard_widgets’);
function my_custom_dashboard_widgets() {
global $wp_meta_boxes;
wp_add_dashboard_widget(‘custom_widget_smp’, ‘Website Issues?’, ‘custom_dashboard_information’);
}
function custom_dashboard_information() {
echo ‘If you need help making changes to your site, you can always contact me via email at <a href="mailto:shawn@spiffydesign.com">shawn@spiffydesign.com</a>.’;
}
/*————————————*
FIX GRAVITARS – USE A BRANDED THING
*————————————*/
/*
Have you seen the default mystery man avatar on blogs? You can easily replace it with your own branded custom avatars. Simply upload the image you want to use as default avatar and then add this code to your functions file.
*/
add_filter( ‘avatar_defaults’, ‘wpb_new_gravatar’ );
function wpb_new_gravatar ($avatar_defaults) {
$myavatar = ‘/wp-content/uploads/2019/06/ccc_gravatar.png’;
$avatar_defaults[$myavatar] = "Default Gravatar";
return $avatar_defaults;
}
/*————————————*
ADMIN NOTIFICATION
*————————————*/
// prevent admin notification email for new registered users or user password changes
function conditional_mail_stop() {
global $phpmailer;
$blogname = wp_specialchars_decode(get_option(‘blogname’), ENT_QUOTES);
$subject = array(
sprintf(__(‘[%s] New User Registration’), $blogname),
sprintf(__(‘[%s] Password Lost/Changed’), $blogname)
);
if ( in_array( $phpmailer->Subject, $subject ) )
// empty $phpmailer class -> email cannot be send
$phpmailer = new PHPMailer( true );
}
add_action( ‘phpmailer_init’, ‘conditional_mail_stop’ );
/*————————————*
ADMIN NOTIFICATION long with ability to shut down user emails
*————————————*/
// DISABLE ADMIN default WordPress new user notification emails
/*if ( ! function_exists ( ‘wp_new_user_notification’ ) ) :
function wp_new_user_notification( $user_id, $deprecated = null, $notify = ” ) {
global $wpdb, $wp_hasher;
$user = get_userdata( $user_id );*/
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
//$blogname = wp_specialchars_decode(get_option(‘blogname’), ENT_QUOTES);
// Generate something random for a password reset key.
//$key = wp_generate_password( 20, false );
/** This action is documented in wp-login.php */
// do_action( ‘retrieve_password_key’, $user->user_login, $key );
// Now insert the key, hashed, into the DB.
/*if ( empty( $wp_hasher ) ) {
$wp_hasher = new PasswordHash( 8, true );
}
$hashed = time() . ‘:’ . $wp_hasher->HashPassword( $key );
$wpdb->update( $wpdb->users, array( ‘user_activation_key’ => $hashed ), array( ‘user_login’ => $user->user_login ) );
$switched_locale = switch_to_locale( get_user_locale( $user ) );
$message = sprintf(__(‘Username: %s’), $user->user_login) . "rnrn";
$message .= __(‘To set your password, visit the following address:’) . "rnrn";
$message .= ‘<‘ . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user->user_login), ‘login’) . ">rnrn";
$message .= wp_login_url() . "rn";
wp_mail($user->user_email, sprintf(__(‘[%s] Your username and password info’), $blogname), $message);
}
endif;*/
// DISABLE BOTH default WordPress new user notification emails
/*if ( ! function_exists( ‘wp_new_user_notification’ ) ) :
function wp_new_user_notification( $user_id, $deprecated = null, $notify = ” ) {
return;
}
endif;*/
/*————————————*
Remove WP Version Number
*————————————*/
// remove version from head
remove_action(‘wp_head’, ‘wp_generator’);
// remove version from rss
add_filter(‘the_generator’, ‘__return_empty_string’);
// remove version from scripts and styles
function shapeSpace_remove_version_scripts_styles($src) {
if (strpos($src, ‘ver=’)) {
$src = remove_query_arg(‘ver’, $src);
}
return $src;
}
add_filter(‘style_loader_src’, ‘shapeSpace_remove_version_scripts_styles’, 9999);
add_filter(‘script_loader_src’, ‘shapeSpace_remove_version_scripts_styles’, 9999);
/*—————————————————–*
FONTAWESOME –
adding bootstrap cdn fontaweome link – Front End
https://fontawesome.com/icons?from=io – icon search area
*———————————————————*/
//enqueues our external font awesome stylesheet
function add_theme_fontawesomecodes() {
wp_enqueue_style( ‘style’, ‘https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css’ ;, ‘all’);}
add_action( ‘wp_enqueue_scripts’, ‘add_theme_fontawesomecodes’ );
/*
https://use.fontawesome.com/releases/v5.0.6/css/all.css
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> ;
*/
/*————————————*
ADD A STYLE SHEET FOR FRONT END
*————————————*/
/* extended admin style */
function cccprojects_style() {
wp_enqueue_style(‘cccprojects-style’, get_stylesheet_directory_uri().’/css/cccprojects_style.css’, false, ‘1.0.0’ );
}
add_action(‘wp_enqueue_scripts’, ‘cccprojects_style’, 99); //99 is priority to get loaded last
/*————————————*
ADD A STYLE SHEET FOR THE LOGIN PAGE – SEE OVERVIEW FOR CSS TAG LIST
*————————————*/
//Replace style-login.css with the name of your custom CSS file
function my_custom_login_stylesheet() {
wp_enqueue_style( ‘custom-login’, get_stylesheet_directory_uri() . ‘/css/login_style.css’ );
}
//This loads the function above on the login page
add_action( ‘login_enqueue_scripts’, ‘my_custom_login_stylesheet’ );
/*————————————*
ENQUEUE CSS FOR ADMIN
*————————————*/
// Update CSS within in Admin
/*
USING HOOKS TO TARGET A SPECIFIC ADMIN PAGE
function my_enqueue($hook) {
if ( ‘edit.php’ != $hook ) {
return;
}
wp_enqueue_script(‘admin-style’, get_stylesheet_directory_uri().’/css/admin_style.css’, false, ‘1.0.0’ );
}
add_action(‘admin_enqueue_scripts’, ‘admin_style’);
*/
/*
function load_custom_wp_admin_style() {
wp_register_style( ‘custom_wp_admin_css’, get_template_directory_uri() . ‘/admin-style.css’, false, ‘1.0.0’ );
wp_enqueue_style( ‘custom_wp_admin_css’ );
}
add_action( ‘admin_enqueue_scripts’, ‘load_custom_wp_admin_style’ );
*/
/* works no hook
function admin_style() {
wp_enqueue_style(‘admin-style’, get_stylesheet_directory_uri().’/css/admin_style.css’, false, ‘1.0.0’ );
}
add_action(‘admin_enqueue_scripts’, ‘admin_style’);
*/
/* have to look at getting hoook to work
function my_enqueue($hook) {
if ( ‘theme-editor.php’ != $hook ) {
return;
}
wp_enqueue_script(‘admin-style’, get_stylesheet_directory_uri().’/css/admin_style.css’, false, ‘1.0.0’ );
}
add_action(‘admin_enqueue_scripts’, ‘admin_style’);
*/
/* regular local site admin style enque
function admin_style() {
wp_enqueue_style(‘admin-style’, get_stylesheet_directory_uri().’/css/admin_style.css’, false, ‘1.0.0’ );
}
add_action(‘admin_enqueue_scripts’, ‘admin_style’);
*/
/* attach admin style to shawneee */
add_action( ‘admin_enqueue_scripts’, ‘register_custom_shawneeecccproj_admin_styles’ );
function register_custom_shawneeecccproj_admin_styles() {
wp_register_style( ‘admin_style’, ‘https://shawneee.com/the/wp-content/themes/astra-child/css/admin_style.css’ ; );
wp_enqueue_style( ‘admin_style’ );
}
/* extended admin style */
function admin_style_cccprojects() {
wp_enqueue_style(‘admin-style-cccprojects’, get_stylesheet_directory_uri().’/css/admin_style_cccproject.css’, false, ‘1.0.0’ );
}
add_action(‘admin_enqueue_scripts’, ‘admin_style_cccprojects’);
/* ———————— *
REMOVE CSS MESSAGE FROM EDITOR
/*——————————-*/
function removeMessage()
{
echo ‘<style> #message { display: none; } </style> ‘;
}
add_action(‘admin_head’, ‘removeMessage’);
/* ———————— *
ADD CSS FOR TINYMCE EDITOR
/*——————————-*/
add_action( ‘after_setup_theme’, ‘my_theme_setup’ );
function my_theme_setup() {
add_editor_style();
// For the Block Editor.
add_theme_support( ‘editor-styles’ );
}
/*———————-*
Adding CUSTOM code to site via hook
/*———————-*/
/*
function storefront_credit() {
?>
<div class="site-info">
Site Info Added
</div>
<?php
}
*/
/* to remove current calendar styles sheets
add_action( ‘wp_enqueue_scripts’, ‘deregister_tribe_styles’ );
function deregister_tribe_styles() {
wp_deregister_style( ‘tribe-events-pro-views-v2-skeleton’ );
wp_deregister_style( ‘tribe-events-pro-views-v2-full’ );
wp_deregister_style( ‘tribe-events-views-v2-skeleton’ );
wp_deregister_style( ‘tribe-events-views-v2-full’ );
wp_deregister_style( ‘tribe-common-skeleton-style’ );
wp_deregister_style( ‘tribe-common-full-style’ );
}
You can then use wp_enqueue_style() in a separate function to load all of your own styles.
*/
[/code]