Skip to content

Instantly share code, notes, and snippets.

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

LOOR Lab loorlab

💻
💥👩‍🚀👨‍🚀💥
View GitHub Profile
@doiftrue
doiftrue / disable-comments.php
Last active August 9, 2024 20:45
[wp-kama embed] https://wp-kama.com/2539 Disable Comments for WordPress. Original code see here: https://github.com/WPDevelopers/disable-comments-mu
<?php
/**
* Plugin Name: Disable Comments (Must Use version)
* Description: Disables all WordPress comment functionality on the entire network.
* Version: 1.1.2 (changed)
* Plugin Changed URI: https://gist.github.com/doiftrue/ab931c1d866cb113b4ff318a5faeb3b3
* Plugin URI: https://github.com/WPDevelopers/disable-comments-mu
* GitHub Plugin URI: https://github.com/WPDevelopers/disable-comments-mu
* Author: WPDeveloper
* Author URI: https://wpdeveloper.com
@alivarzeshi
alivarzeshi / Alivarzeshi
Last active October 12, 2024 16:00
Optimizing WordPress performance
‎‎​
@felipeabajo
felipeabajo / wordpress-sharing-buttons
Created February 9, 2024 22:38
Sharing buttons for WordPress
add_filter( 'the_content', function ( $content ) { if ( is_singular( 'post' ) ) {
/*********************
* choose icons
**********************/
$facebook = 1;
$twitter = 1;
$LinkedIn = 1;
$threads = 1;
$email = 1;
@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
@crazyyy
crazyyy / other-wp-seo.php
Created September 15, 2023 01:38
WordPress SEO Yoast improvements
<?php
/**
* Set the custom Open Graph image URL for specific conditions.
* Add custom Twitter Social Share images for Yoast SEO for Archive pages
*
* @param string $image The default Open Graph image URL.
* @return string The custom Open Graph image URL, or the default URL if not found.
*/
function artkai_set_custom_category_og_image($image) {
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
@gr1zix
gr1zix / 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;