Skip to content

Instantly share code, notes, and snippets.

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

Mohammad Limon mlbd

🏠
Working from home
View GitHub Profile
// custom get_archive_title() modifier
if ( ! function_exists( 'seoleader_get_the_archive_title' ) ) {
function seoleader_get_the_archive_title() {
if ( is_category() ) {
/* translators: Category archive title. 1: Category name */
$title = single_cat_title( '', false );
} elseif ( is_tag() ) {
/* translators: Tag archive title. 1: Tag name */
$title = single_tag_title( '', false );
/**
* Move Comment field to bottom
*/
if ( !function_exists( 'prefix_move_comment_field_to_bottom' ) ) :
function neer_move_comment_field_to_bottom( $fields ) {
$comment_field = $fields['comment'];
unset( $fields['comment'] );
$fields['comment'] = $comment_field;
return $fields;
}
@mlbd
mlbd / Modify $before_widget from Widget Class
Last active February 14, 2018 08:12
Add different class every second and third in WordPress Widget
/**
* Modify before_widget from Widget Class
*/
if ( !function_exists( 'pixicleaner_filter_dynamic_sidebar_params' ) ) :
function pixicleaner_filter_dynamic_sidebar_params($params){
static $sidebar_widget_count = array();
$sidebar_id = $params[0]["id"];
if ( $sidebar_id == 'pixicleaner_footer_widgets' ) :
function widget( $args, $instance ) {
extract( $args );
... //other code
$widget_width = !empty($instance['widget_width']) ? $instance['widget_width'] : "col300";
/* Add the width from $widget_width to the class from the $before widget */
// no 'class' attribute - add one with the value of width
if( strpos($before_widget, 'class') === false ) {
// include closing tag in replace string
$before_widget = str_replace('>', 'class="'. $widget_width . '">', $before_widget);
@mlbd
mlbd / SublimeOnSaveBuild.sublime-settings
Created February 22, 2018 09:08 — forked from jawinn/SublimeOnSaveBuild.sublime-settings
Regex to ignore SASS / LESS partials (files starting with underscore) from being built by SublimeOnSaveBuild
// UPDATED VERSION
{
"filename_filter": "(/|\\\\|^)(?!_)(\\w+)\\.(css|js|sass|less|scss)$",
"build_on_save": 1
}
// DEFAULT (for reference, in case you need it back)
{
"filename_filter": "\\.(css|js|sass|less|scss)$",
"build_on_save": 1
@mlbd
mlbd / SASS - Both.sublime-build
Created February 22, 2018 09:58 — forked from dropddesigns/SASS - Both.sublime-build
SASS Build script to build both uncompressed and compress CSS files
{
"cmd": [
"sass", "--update", "--watch", "$file:${file_path}/${file_base_name}.css", "--sourcemap=none", "--stop-on-error", "--no-cache", "--style", "expanded",
"&",
"sass", "--update", "$file:${file_path}/${file_base_name}.min.css", "--stop-on-error", "--no-cache", "--style", "compressed"
],
"selector": "source.sass, source.scss",
"line_regex": "Line ([0-9]+):",
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Edit with Sublime Text]
@="Edit with &Sublime Text"
"Icon"="C:\\Program Files\\Sublime Text 3\\sublime_text.exe,0"
"MuiVerb"="Edit with Sublime Text"
[HKEY_CLASSES_ROOT\*\shell\Edit with Sublime Text\command]
@="C:\\Program Files\\Sublime Text 3\\sublime_text.exe \"%1\""
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
{
"cmd": [
"sass", "--update", "--watch", "$file:${file_path}/../css/${file_base_name}.css", "--sourcemap=none", "--stop-on-error", "--no-cache", "--style", "expanded",
"&",
"sass", "--update", "$file:${file_path}/../css/${file_base_name}.min.css", "--stop-on-error", "--no-cache", "--style", "compressed"
],
"selector": "source.sass, source.scss",
"line_regex": "Line ([0-9]+):",