A Pen by Fahad Murtaza on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Filter the content to remove ADULTKEYWORD. This is an example plugin | |
*/ | |
add_filter('the_content', 'fm_filter_the_main_loop', 1); | |
function fm_filter_the_main_loop($content) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Hello World New | |
*/ | |
function hello_world_new() { | |
return '<p>Hello World!</p>'; | |
} | |
add_shortcode( 'hello_world_new', 'hello_world_new' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// WordPress List all posts from last month | |
$args = array( | |
'post_type' => 'post', | |
'posts_per_page' => -1, | |
'post_status' => 'publish', | |
'orderby' => 'date', | |
'order' => 'DESC', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function calculateDaysBetweenDates() { | |
// set time zone to karachi | |
date_default_timezone_set('Asia/Karachi'); | |
$startDate = new DateTime( 'last thursday' ); | |
$endDate = new DateTime( 'today' ); | |
$interval = $startDate->diff( $endDate ); | |
return $interval->format( '%a' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro | |
# | |
WP_OWNER=changeme # <-- wordpress owner | |
WP_GROUP=changeme # <-- wordpress group | |
WP_ROOT=/home/changeme # <-- wordpress root directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ------------------------------------------------- | |
# Make site directory | |
# Download WP and install WP to site directory | |
# Set WP configuration | |
# Configure NGINX for new domain-name | |
# ------------------------------------------------- | |
# apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add to functions.php | |
add_filter( 'facetwp_facet_dropdown_show_counts', '__return_false' ); | |
function fwp_wrapper_open() { | |
echo '<div class="facetwp-template"><!-- start facetwp template -->'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) { | |
if ( '' == FWP()->helper->get_uri() && 'dealerships' != $query->get( 'post_type' ) ) { | |
return false; | |
} | |
return $is_main_query; | |
}, 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => 'http://localhost:8090/echo', | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => '', | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 0, |