Skip to content

Instantly share code, notes, and snippets.

@SitesByYogi
SitesByYogi / var.php
Created June 21, 2023 14:18
PHP Variables and Data Types
<?php
$name = "John Doe"; // string
$age = 25; // integer
$price = 9.99; // float
$isStudent = true; // boolean
$fruits = array("apple", "banana", "orange"); // array
?>
@SitesByYogi
SitesByYogi / syntax.php
Created June 21, 2023 14:15
PHP Syntax
<?php
// PHP code goes here
?>
@SitesByYogi
SitesByYogi / dismiss.php
Created June 6, 2023 18:11
dismiss total upkeep admin notice
add_action( 'wp_head', 'dismiss_tu_admin_notice' );
function dismiss_tu_admin_notice() {
?><style>
.notice notice-warning .is-dismissible boldgrid-backup-protect-now {
display: none !important;
}
</style><?php
}
@SitesByYogi
SitesByYogi / error.text
Created May 15, 2023 15:37
crio/wp6.2/ErrorLog
#0 /home/dh_uytzv7/hemstitchrentals.com/wp-content/themes/crio/inc/boldgrid-theme-framework/includes/customizer/class-boldgrid-framework-customizer-generic.php(303): Boldgrid_Framework_Customizer_Generic->create_media_prefix(Array)
#1 /home/dh_uytzv7/hemstitchrentals.com/wp-content/themes/crio/inc/boldgrid-theme-framework/includes/customizer/class-boldgrid-framework-customizer-generic.php(128): Boldgrid_Framework_Customizer_Generic->device_visibility_styles(Array)
#2 /home/dh_uytzv7/hemstitchrentals.com/wp-content/themes/crio/inc/boldgrid-theme-framework/includes/customizer/class-boldgrid-framework-customizer-generic.php(90): Boldgrid_Framework_Customizer_Generic->get_default_styles(Array)
#3 /home/dh_uytzv7/hemstitchrentals.com/wp-includes/class-wp-hook.php(308): Boldgrid_Framework_Customizer_Generic->add_styles(”)
#4 /home/dh_uytzv7/hemstitchrentals.com/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
#5 /home/dh_uytzv7/hemstitchrentals.com/wp-includes/plugin.php(517): WP_Hook->do_act
@SitesByYogi
SitesByYogi / errorlog.txt
Created May 9, 2023 19:28
1optionplatform error log
<pre><code>
[2023-05-09 17:09:45 UTC] PHP Version: 7.4.28
[2023-05-09 17:09:45 UTC] WordPress Version: 6.2
[2023-05-09 17:09:45 UTC] Total Upkeep version: 1.15.6
[2023-05-09 17:09:45 UTC] getpgid support: Available
[2023-05-09 17:09:45 UTC] Backup process initialized.
[2023-05-09 17:09:45 UTC] Process id: 8793
[2023-05-09 17:09:45 UTC] --------------------------------------------------------------------------------
[2023-05-09 17:09:45 UTC] Starting dump of database...
[2023-05-09 17:09:45 UTC] Memory usage - limit / current / peak memory usage: 1073741824 / 14664888 (13.99 MB) / 15941928 (15 MB)
@SitesByYogi
SitesByYogi / add-seo.php
Created April 17, 2023 16:01
add boldGrid SEO to WooCommerce
<?php
/**
* Copy this sample file to config.local.php and update it with any variables that you would like to override
*/
return array(
'meta-box' => array(
'post_types' => array(
'post',
'page',
'product'
@SitesByYogi
SitesByYogi / single-video.html
Created March 7, 2023 13:02
Simple BoldGrid Video Block
<div class="tmpl-media-10 boldgrid-section dynamic-gridblock">
<div class="container">
<div class="row" style="padding-top: 20px; padding-bottom: 20px;">
<div class="col-md-12 col-xs-12 col-sm-12 text-center col-lg-12">
<div class="bg-video bg-video-2 color1-border-color" data-imhwpb-draggable="true">
[embed height="630" width="1120"]https://vimeo.com/505335690[/embed]
</div>
</div>
@SitesByYogi
SitesByYogi / sprout_egp.php
Last active January 13, 2023 14:47
ADD support for EGP (Egyptian currency) to Sprout Invoices
<?php
// do not include above code
function si_filter_localeconv( $localeconv = array(), $doc_id = 0, $locale = '' ) {
switch ( $locale ) {
case 'en_GB':
$localeconv = egp_local_array();
break;
case 'en_US':
$localeconv = us_local_array();
@SitesByYogi
SitesByYogi / add_css.php
Last active December 20, 2022 16:47
Add CSS to WordPress using (child) theme's functions.php file or a custom plugin.
<?php
add_action( 'wp_head', 'my_unique_css_func_name' );
function my_unique_css_func_name() {
?><style>
/* Your styles here */
</style><?php
}
@SitesByYogi
SitesByYogi / toolbar-link.php
Created December 17, 2022 01:02
Adds a custom link to the WordPress Toolbar