Skip to content

Instantly share code, notes, and snippets.

View loorlab's full-sized avatar
💻
💥👩‍🚀👨‍🚀💥

LOOR Lab loorlab

💻
💥👩‍🚀👨‍🚀💥
View GitHub Profile
@juanboterotech
juanboterotech / backup_wordpress.sh
Created January 5, 2024 04:05
Backup your WordPress website
#!/bin/bash
# get current date
now = `date +"%Y-%m-%d"`
# copying WordPress files inside public_html folder
cd ~/public_html
tar -zcf "~/wordpress_$_now.tar.gz" wordpress_folder
# Database backup with mysqldump
Created header using this plugin: https://wordpress.org/plugins/header-footer-elementor/
Step 1 – Now edit the above header in Elementor and add a Custom ID to the outermost section (here we are using my-custom-id ).
Step 2 – Now add following custom CSS. You can add it to the customizer under the ‘Additional CSS’ section or use
any external plugin that provides an area to add custom CSS.
#custom-sticky-section.elementor-section{
position: fixed;
left: 0;
/**
* Add Font Group
*/
add_filter( 'elementor/fonts/groups', function( $font_groups ) {
$font_groups['rb_custom_fonts'] = __( 'RB Custom Fonts' );
return $font_groups;
} );
/**
* Add Group Fonts
@fgdaniel
fgdaniel / custom-permalink-for-post-type.php
Last active April 18, 2024 03:02
Custom permalink from the root of the site
<?php
if (!defined('ABSPATH')) return; // Exit if accessed directly.
// Attention
// You must have ACF and ACF Extended installed, you need a group made with a slug field that will be called 'custom_permalink' and select on which post-type to appear. Example: https://i.imgur.com/aTNpHoU.png
// For custom permalink of an archive you have to activate the option here: https://i.imgur.com/SOvcbBj.png and in the group with the field 'custom_permalink' you have to select on which archive to appear, example: https://i.imgur.com/dKLfDEJ.png
// Example of an archive: https://i.imgur.com/owENTRB.png if you do not complete 'custom_permalink' then the default will be the '$default_slug' variable
// If you do not want custom url rewrite on an archive you can comment the line 'add_filter('post_type_archive_link', [$this, 'archive_link'], 10, 2);' and line '$rules['^' . $custom_url . '/?$'] = $path;'
// Replace 'example' with your post-type name
@AlexMcDee
AlexMcDee / app.css
Created September 7, 2021 08:54
Elementor register custom font (Font will be listed on Elementor fonts selector)
/* Enabling font which stored on fonts/ folder */
@font-face {
font-family: 'Organetto';
src: url('fonts/Organetto-Light.eot');
src: local('Organetto Light'), local('Organetto-Light'),
url('fonts/Organetto-Light.eot?#iefix') format('embedded-opentype'),
url('fonts/Organetto-Light.woff2') format('woff2'),
url('fonts/Organetto-Light.woff') format('woff'),
url('fonts/Organetto-Light.ttf') format('truetype'),
url('fonts/Organetto-Light.svg#Organetto-Light') format('svg');
@AaronSadlerUK
AaronSadlerUK / MemberAuthenticationSurfaceController.cs
Last active August 31, 2022 03:05
How to create member login and logout form in Umbraco V9 (RC)
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Cache;
using Umbraco.Cms.Core.Logging;
using Umbraco.Cms.Core.Routing;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Web;
using Umbraco.Cms.Infrastructure.Persistence;
using Umbraco.Cms.Web.Common.Models;
@gziolo
gziolo / dev-note-5.8-block-editor.md
Last active March 7, 2023 00:50
Block Editor filter changes in WordPress 5.8

Block Editor Changes

We have reached the first WordPress core release where the post editor is no longer the only screen that uses the block editor. In the middle of the development process, we found out that several WordPress hooks defined on the server depended on the $post object that isn’t present on the updated screen that lets users edit widgets using blocks. Therefore, we decided to deprecate some of the existing filters and introduce their context-aware replacements. This way, we ensure that we can continue iteratively enabling the block-based paradigm on different screens like the navigation editor screen by leveraging the new WP_Block_Editor_Context class that will receive more capabilities over time. There are also new methods introduced that allow code reuse for the functionality that needs to be shared between the screen that uses the block editor.

Related Trac ticket: #52920.

Class

WP_Block_Editor_Context

<?php
// Trigger Holiday Mode
add_action ('init', 'bbloomer_woocommerce_holiday_mode');
// Disable Cart, Checkout, Add Cart
function bbloomer_woocommerce_holiday_mode() {
<div class="form-group">
<label for="departamento"><strong>DEPARTAMENTO</strong></label>
<select class="form-control" id="departamento" name="departamento" required>
<option value = ""> </option>
<option value = "Amazonas">Amazonas</option>
<option value = "Antioquia">Antioquia</option>
<option value = "Arauca">Arauca</option>
<option value = "Atlántico">Atlántico</option>
<option value = "Bolívar">Bolívar</option>
<option value = "Boyacá">Boyacá</option>
@bgoonz
bgoonz / embeds.html
Last active December 24, 2021 06:57
Embeds
<!---RESUME------>
<iframe src="https://onedrive.live.com/embed?resid=D21009FDD967A241%21491611&amp;authkey=%21AFXfUVYrqPU2h5o&amp;em=2" width="600px" height="1000px" frameborder="0">This is an embedded <a target="_blank" href="https://office.com">Microsoft Office</a> document, powered by <a target="_blank" href="https://office.com/webapps">Office</a>.</iframe>
<!---Portfolio------>
<!----------------------------------google form---------------------------------------->