Skip to content

Instantly share code, notes, and snippets.

View mmarj's full-sized avatar
🏠
Spreading H@ppiness!!

Mir Md Aurangajeb mmarj

🏠
Spreading H@ppiness!!
View GitHub Profile
@mmarj
mmarj / functions.php
Created October 27, 2021 14:05 — forked from vovafeldman/functions.php
Freemius - weDocs Permalinks
<?php
/**
* Customize docs permalinks parsing.
*
* @author Vova Feldman
*/
function freemius_docs_permastruct_rewrite() {
if ( post_type_exists( 'docs' ) ) {
// Modify root slug to "help" instead of docs.
@mmarj
mmarj / _sections-header.scss
Created October 27, 2021 14:01 — forked from vovafeldman/_sections-header.scss
Freemius - weDocs Pretty Sections
// Header search
.page-header
{
.wedocs-search-form
{
position: relative;
input
{
@include placeholder(#999);
@mmarj
mmarj / functions.php
Created August 25, 2021 18:39 — forked from danjjohnson/functions.php
WPJM: Limit file upload size
<?php
function limit_upload_size_limit_for_non_admin( $limit ) {
if ( ! current_user_can( 'manage_options' ) ) {
$limit = 1000000; // 1mb in bytes
}
return $limit;
}
add_filter( 'upload_size_limit', 'limit_upload_size_limit_for_non_admin' );
@mmarj
mmarj / .htaccess
Created July 7, 2021 14:39 — forked from ShiponKarmakar/.htaccess
Most Useful and Helpful .htaccess Code
#stop directory browsing
Options All -Indexes
# SSL Https active Force non-www
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
@mmarj
mmarj / functions.php
Created July 6, 2021 16:25 — forked from tareq1988/functions.php
Dokan seller info in popup on store page
<?php
add_action( 'wp_enqueue_scripts', function() {
if ( ! dokan_is_store_page() ) {
return;
}
wp_enqueue_style('dokan-magnific-popup');
wp_enqueue_script('dokan-popup');
} );
@mmarj
mmarj / add-ajax-extended.php
Created May 11, 2021 18:46 — forked from obiPlabon/add-ajax-extended.php
Register ajax action hook.
<?php
/**
* Register ajax action hook.
*
* When you have lots of ajax actions in your theme or plugin then
* this utility function is going to be quite handy!
* By default all actions are for logged in users.
*
* Usage:
* add_ajax( 'get_infinity_posts', 'prefix_get_infinity_posts' ); // for logged in only
@mmarj
mmarj / gettext-filter-multiple.php
Created February 20, 2021 20:16 — forked from BFTrick/gettext-filter-multiple.php
Use the gettext WordPress filter to change any translatable string.
<?php
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Sale!' :
$translated_text = __( 'Clearance!', 'woocommerce' );
User Testing / Usability / Data Analytics
---------------------------------------------------------------------------
https://lookback.io/
https://usabilityhub.com/
https://www.hotjar.com/
https://www.smartlook.com/
https://www.usertesting.com/
https://www.inspectlet.com/
https://recorder.userlook.co/
https://userlook.co/
@mmarj
mmarj / gutenberg.txt
Created December 25, 2020 00:06 — forked from chrismccoy/gutenberg.txt
Gutenberg Resources
10 Stunning Button Hover Effects for Gutenberg Button Block
https://gutenberghub.com/10-stunning-button-hover-effects-for-gutenberg-button-block/
How to use Background Patterns in Gutenberg using CSS only
https://gutenberghub.com/how-to-use-background-patterns-in-gutenberg-using-css-only/
How to create a visual sitemap in Gutenberg without any plugin
https://gutenberghub.com/how-to-create-a-visual-sitemap-in-gutenberg-without-any-plugin/
WordPress Block Development Made Easy
@mmarj
mmarj / www-post-thumb.php
Created December 24, 2020 13:31 — forked from gmazzap/www-post-thumb.php
WordPress plugin that allow to use an external image url as featured image.
<?php namespace GM\WWWPostThumbnail;
/**
* Plugin Name: WWW Post Thumbnail
* Description: Allow to use an external image url as featured image.
* Plugin URI: https://gist.github.com/Giuseppe-Mazzapica/928bc22e5f49a654cf7c
* Author: Giuseppe Mazzapica
* Author URI: https://github.com/Giuseppe-Mazzapica
* License: MIT
* Version: 0.1.0
*