Skip to content

Instantly share code, notes, and snippets.

@SitesByYogi
SitesByYogi / custom-dashwidget.php
Created July 24, 2022 00:35
Add a custom dashboard widget to WordPress admin
<?php
add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
function my_custom_dashboard_widgets() {
global $wp_meta_boxes;
wp_add_dashboard_widget('custom_help_widget', 'Theme Support', 'custom_dashboard_help');
}
@SitesByYogi
SitesByYogi / expand-profile.php
Created July 24, 2022 02:17
Expand the WordPress User Profile page
<?php
add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
function my_show_extra_profile_fields( $user ) { ?>
<h3>Employee Information</h3>
@SitesByYogi
SitesByYogi / custom-functions.php
Created July 24, 2022 18:24
Adds a custom functions file to your wordpress file struction. Be sure to create a new folder and connect it.
<?php
//=========================================================
// Add Custom functions file to WordPress
//=========================================================
$roots_includes = array(
'/theme-functions/theme-colors.php'
);
@SitesByYogi
SitesByYogi / cpt.php
Last active August 1, 2022 00:24
Setup Custom Post Type for WordPress
<?php
/*
* Creating a function to create our CPT
*/
function custom_post_type() {
// Set UI labels for Custom Post Type
$labels = array(
'name' => _x( 'Artist', 'Post Type General Name', 'nfinite' ),
@SitesByYogi
SitesByYogi / cpt-query.php
Created August 1, 2022 00:09
Query Custom Post Type in your WordPress Template
<?php
$args = array( 'post_type' => 'movies', 'posts_per_page' => 10 );
$the_query = new WP_Query( $args );
?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<h2><?php the_title(); ?></h2>
<div class="entry-content">
<?php the_content(); ?>
</div>
@SitesByYogi
SitesByYogi / disable-admin.css
Created August 5, 2022 21:53
disable wp admin with css
#wpadminbar ul#wp-admin-bar-root-default>li {
margin-right: 0;
display: none;
}
@SitesByYogi
SitesByYogi / sbci.php
Created September 22, 2022 17:36
(SproutBillings) - Card input Workaround
<?php if ( 'false' === get_option( 'si_plaid_ach_only' ) ) : ?>
<div class="row description">
<p><?php esc_html_e( 'Please select from the payment types below. Saving your payment information is secure and makes things easier for the future', 'sprout-invoices' ); ?></p>
</div>
<div class="sa-control-group ">
<span class="label_wrap">
<label for="sa_credit_payment_method"><?php esc_html_e( 'Payment Method', 'sprout-invoices' ); ?></label> <span class="required">*</span>
</span>
<span class="input_wrap">
@SitesByYogi
SitesByYogi / change-sender.php
Created October 3, 2022 00:20
Manually Change WordPress Sender Name and Email Address
<?php
// Function to change email address
function wpb_sender_email( $original_email_address ) {
return 'tim.smith@example.com';
}
// Function to change sender name
function wpb_sender_name( $original_email_from ) {
return 'Tim Smith';
@SitesByYogi
SitesByYogi / boldgrid-layout-single.html
Last active October 3, 2022 17:59
BoldGrid Block layout - Text aligned right with image left
<div class="boldgrid-section" style="border-width: 0px; background-color: #1a2533;">
<div class="container">
<div class="row" style="padding-top: 75px; padding-bottom: 75px; border-width: 0px;">
<div class="col-lg-6 col-md-12 col-xs-12 col-sm-12 color4-border-color" style="border-width: 2px 0px 0px; padding-right: 1em;">
<h2 class="" style="border-width: 0px; font-family: 'Yanone Kaffeesatz'; font-weight: 400; color: #f9fdff;" data-font-family="Yanone Kaffeesatz" data-font-weight="400" data-font-style="">SUMMER CAMPS</h2>
<p class="" style="border-width: 0px; color: #f9fdff;">What better way to spend the summer than on a tallship!</p>
<p class="" style="border-width: 0px; color: #f9fdff;">Children’s Maritime Institute in partnership with Los Angeles Maritime Institute offers summer programs for students ages 6-17. Young learners can join us for day camps, while older kids sail with us for 5 or 12-day trips. Youth become part of the crew, set sail, snorkel, swim, and enjoy time on the islands of California.</p
@SitesByYogi
SitesByYogi / ppb-contact.html
Last active October 12, 2022 13:05
Contact us section with info left and map right
<div class="tmpl-contact-3 boldgrid-section dynamic-gridblock" style="border-width: 0px;" data-alpha="0.78">
<div class="container">
<div class="row" style="padding-top: 50px; padding-bottom: 50px; border-width: 0px;">
<div class="col-md-6 col-xs-12 col-sm-6 col-lg-6" style="padding: 1em;">
<h2>Contact Us</h2>
<p class="">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam eu dignissim tortor, sit amet bibendum lacus. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<div class="row" style="padding-top: 25px;">
<div class="col-md-2 col-sm-2 col-xs-2 col-lg-2">
<p class="" style="text-align: center;"><i class="fa fa-map-signs color3-background-color color-3-text-contrast bg-background-color" style="border-radius: 50px; padding: 0.7em; font-size: 20px;" aria-hidden="true"><span style="display: none;">&nbsp;</span></i></p>