Skip to content

Instantly share code, notes, and snippets.

View sabrysuleiman's full-sized avatar
🏠
Working from home

Sabry Suleiman sabrysuleiman

🏠
Working from home
View GitHub Profile
@sabrysuleiman
sabrysuleiman / wp-query-ref.php
Created January 22, 2020 22:25 — forked from luetkemj/wp-query-ref.php
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@sabrysuleiman
sabrysuleiman / fix-wordpress-permissions.sh
Created April 3, 2020 19:08 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@sabrysuleiman
sabrysuleiman / OtTaxonomiesMetabox.php
Created April 12, 2020 05:06 — forked from merianos/OtTaxonomiesMetabox.php
WordPress Taxonomies / Users MetaBox using OptionTree
<?php
/**
* Created by PhpStorm.
* User: merianos
* Date: 6/7/2018
* Time: 8:39 μμ
*/
class OtTaxonomiesMetabox {
@sabrysuleiman
sabrysuleiman / taxonomy-radio-metabox.php
Created April 12, 2020 05:12 — forked from jtsternberg/taxonomy-radio-metabox.php
Removes and replaces the built-in taxonomy metabox with our radio-select metabox.
<?php
if ( !class_exists( 'WDS_Taxonomy_Radio' ) ) {
/**
* Removes and replaces the built-in taxonomy metabox with our radio-select metabox.
* @link http://codex.wordpress.org/Function_Reference/add_meta_box#Parameters
*/
class WDS_Taxonomy_Radio {
// Post types where metabox should be replaced (defaults to all post_types associated with taxonomy)
@sabrysuleiman
sabrysuleiman / meta-tags.md
Created April 28, 2020 05:19 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@sabrysuleiman
sabrysuleiman / Google Blogger Social Meta Tags.html
Created April 28, 2020 05:26 — forked from sverrirs/Google Blogger Social Meta Tags.html
Because it is notoriously difficult, here is how you integrate social media tags for Facebook, Twitter, Google+ and Pinterest into Google Blogger template. Tested and validated by myself on blogger.com in August 2015. This is based on https://gist.github.com/MilanAryal/92997b311580c6e96dd0 but with important fixes and different integration strat…
<!-- add the following code in the head and body tags -->
<head prefix='og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#'>
<body itemscope='itemscope' itemtype='http://schema.org/Blog' prefix='og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#'>
<!--
I've found easiest to simply include the rest of the tags in the body of the webpage.
The browser will automatically interpret the should-be header tags correctly.
The only problem, and unavoidable when using a blogger template is that the Pintrest markup
will not currently work with their Rich Pin validation tool.
@sabrysuleiman
sabrysuleiman / mdr-table-of-contents.less
Created July 15, 2020 21:17 — forked from mattrude/mdr-table-of-contents.less
Table of Contents shortcode for WordPress
// Creates a small boarder around the table.
.table_of_contents.fl {
float: right;
margin: 0 0 15px 15px;
padding: 5px;
border: 1px solid #AAA;
}
@sabrysuleiman
sabrysuleiman / wp_theme_files_creator.php
Created April 18, 2021 04:58
Fast way To Create Wordpress theme files in php
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Sabry Lets Go!</title>
<style>
* {box-sizing:border-box;}
body {margin:0;padding:0;background:#eee;}
.container {display:block;position:relative;background:#fff;border:1px solid #ddd;padding:15px;border-radius:10px;margin:100px 15%;width:70%;}
input {width:100%;margin-bottom:10px;}
@sabrysuleiman
sabrysuleiman / find_duplicate_wordpress_attachment_IDs.sql
Created April 29, 2021 05:31
Find Duplicate Wordpress Attachment IDs
SELECT
`meta_key`,
`meta_value`,
COUNT(`meta_value`)
FROM wp_postmeta
GROUP BY `meta_value`
HAVING COUNT(`meta_value`) > 1 AND `meta_key` IN (
'_wp_attached_file',
'_wp_attachment_backup_sizes',
'_wp_attachment_metadata',
@sabrysuleiman
sabrysuleiman / awesome-php.md
Created May 13, 2021 08:19 — forked from llbbl/awesome-php.md
Awesome PHP Libraries and Resources

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Categories

  • Composer
  • Composer Related
  • Frameworks
  • Micro Frameworks