Skip to content

Instantly share code, notes, and snippets.

View MariaJackson1's full-sized avatar

Maria Jackson MariaJackson1

View GitHub Profile
@MariaJackson1
MariaJackson1 / gist:c92db24561ecbcddb76caa138647987d
Created June 13, 2020 05:08 — forked from tomusborne/gist:e45f6e9d51e980f72b586e2a143324a7
Set GenerateBlocks Container padding to 0 by default.
add_filter( 'generateblocks_defaults', function( $defaults ) {
$defaults['container']['paddingTop'] = '';
$defaults['container']['paddingRight'] = '';
$defaults['container']['paddingBottom'] = '';
$defaults['container']['paddingLeft'] = '';
return $defaults;
} );
@MariaJackson1
MariaJackson1 / Link Styling With Underline
Last active August 8, 2022 20:35
Link Styling With Underline
@MariaJackson1
MariaJackson1 / Custom Dashboard Widget
Last active August 8, 2022 20:35
Custom Dashboard Widget
https://www.wpbeginner.com/wp-themes/how-to-add-custom-dashboard-widgets-in-wordpress/
Add to functions.php
Don't forget to change email
add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
function my_custom_dashboard_widgets() {
global $wp_meta_boxes;
@MariaJackson1
MariaJackson1 / Custom Color Palettes
Last active August 8, 2022 20:36
Custom Color Palettes
/* Custom Color Palette Changes Colors in Customizer */
add_filter( 'generate_default_color_palettes', 'mj_custom_color_palettes' );
function mj_custom_color_palettes( $palettes ) {
$palettes = array(
'#ffffff',
'#fafafa',
'#e1e1e1',
'#191919',
'#000000',
@MariaJackson1
MariaJackson1 / GenerateBlocks Move Icon to Right of Headline
Last active August 8, 2022 20:36
GenerateBlocks Move Icon to Right of Headline
https://generatepress.com/forums/topic/generate-blocks-headline-icon-to-the-right/?fbclid=IwAR28o2nTJMjCFqAfFb6drDOqFOtGxh6BSHrTzgbJ68EhvwA0LQdUY_ro4j0#post-1300519
@MariaJackson1
MariaJackson1 / Show Secondary Menu to Logged in Users
Last active August 8, 2022 20:36
Show Secondary Menu to Logged in Users
// Show Secondary Menu to Logged in Users
add_filter( 'has_nav_menu', 'tu_disable_secondary_nav_logged_out', 10, 2 );
function tu_disable_secondary_nav_logged_out( $has_nav_menu, $location ) {
if ( 'secondary' === $location && ! is_user_logged_in() ) {
return false;
}
return $has_nav_menu;
}
@MariaJackson1
MariaJackson1 / Redirect After Login
Last active August 8, 2022 20:37
Redirect After Login
https://stackoverflow.com/questions/8127453/redirect-after-login-on-wordpress/8127629#8127629
Put in functions.php change '/members-home-page' to the slug of the page you want them to go to
// Redirect Logged in Users to Members Only Homepage
function admin_default_page() {
return '/members-home-page';
}
add_filter('login_redirect', 'admin_default_page');
@MariaJackson1
MariaJackson1 / Fluid Type Scale
Last active August 8, 2022 20:37
Fluid Type Scale
body {
font-size: 22px;
}
@media (min-width: 320px) {
body {
font-size: calc(20px + (22 - 20) * ((100vw - 320px) / (1200 - 320)));
}
}
@MariaJackson1
MariaJackson1 / Fluid Type Scale H1 @ 93px
Last active August 8, 2022 20:37
Fluid Type Scale H1 @ 93px
* Updated 5/16/20 Based on 1200 wide
** Typography Generator: https://websemantics.uk/tools/responsive-font-calculator/
/* --------------- Fluid Typography ------------------
-----per css tricks article: https://css-tricks.com/snippets/css/fluid-typography/ --------------------------------- */
/* Calculation --------------------------------------------------
font-size: calc(min font size in px + (max font size DO NOT INCLUDE PX - min font size NO PX) * ((100vw - min viewport width px) / (max minus min viewport width no px)));
@MariaJackson1
MariaJackson1 / Replace Howdy With Hello
Last active August 9, 2022 22:05
Replace Howdy With Hello #dev
/**
* Replace Howdy With Hello
*/
function replace_howdy( $wp_admin_bar ) {
$my_account=$wp_admin_bar->get_node('my-account');
$newtitle = str_replace( 'Howdy,', 'Hello,', $my_account->title );
$wp_admin_bar->add_node( array(
'id' => 'my-account',
'title' => $newtitle,