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 /* Template Name: Custom Template */ ?> | |
<?php get_header(); ?> | |
<div id="primary" class="content-area"> | |
<main id="main" class="site-main" role="main"> | |
<?php | |
// Start the loop. | |
while ( have_posts() ) : the_post(); | |
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
function get_delete_old_post() | |
{ | |
// WP_Query arguments | |
$args = array( | |
'fields' => 'ids', // Only get post ID's to improve performance | |
'post_type' => array( | |
'post' | |
) , //post type if you are using default than it will be post |
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
# Click RAW button above, select all and copy (Ctrl-C) then paste (Ctrl-V) before all other rules in .htaccess file | |
# Wish to "deny" countries from accessing your site, see IP2Location: http://www.ip2location.com/blockvisitorsbycountry.aspx | |
RewriteEngine on | |
# Security related. Block browser access to log files | |
<Files ~ "\.log$"> | |
Order allow,deny | |
</Files> |
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
/* | |
Theme Name: Child Theme | |
Template: wp-bootstrap-starter | |
*/ |
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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{SERVER_PORT} !^443$ | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] |
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
remove_action('wp_head', 'rsd_link'); //removes EditURI/RSD (Really Simple Discovery) link. | |
remove_action('wp_head', 'wlwmanifest_link'); //removes wlwmanifest (Windows Live Writer) link. | |
remove_action('wp_head', 'wp_generator'); //removes meta name generator. | |
remove_action('wp_head', 'wp_shortlink_wp_head'); //removes shortlink. | |
remove_action('wp_head', 'feed_links', 2 ); //removes feed links. | |
remove_action('wp_head', 'feed_links_extra', 3 ); //removes comments feed. | |
remove_action('wp_head', 'wp_resource_hints', 2 ); // remove WP 4.9+ dns-prefetch | |
remove_action('wp_head', 'print_emoji_detection_script', 7 ); // remove WP 4.2+ emoji | |
remove_action('admin_print_scripts', 'print_emoji_detection_script' ); // remove WP 4.2+ emoji | |
remove_action('wp_print_styles', 'print_emoji_styles' ); // remove WP 4.2+ emoji |
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
// wp_html_compression | |
class WP_HTML_Compression | |
{ | |
// Settings | |
protected $compress_css = true; | |
protected $compress_js = true; | |
protected $info_comment = true; | |
protected $remove_comments = true; | |
// Variables |
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 script to head with wrapping php | |
*/ | |
function addtohead_cf() { | |
?> | |
<script></script> | |
<?php | |
} | |
add_action('wp_head', 'addtohead_cf'); |
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
<button onClick="fbq('track', 'Purchase');">Button Text</button> | |
Or you could create a function that pushes the event. The advantage is if you have multiple HTML elements, you can call a single function when someone clicks any of them; you don't have to define individual onClick element. | |
For example, to push the event: | |
<script> | |
function onClick() { | |
fbq('track', 'Purchase'); | |
}; | |
</script> |
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
apt install roundcube-core roundcube-mysql roundcube-plugins | |
wget http://c.vestacp.com/0.9.8/debian/apache2-webmail.conf -O /etc/roundcube/apache.conf | |
nano /etc/roundcube/debian-db.php (enter password) | |
cd /usr/share | |
mv roundcube roundcube-bk | |
rm -r roundcube | |
wget https://github.com/roundcube/roundcubemail/releases/download/1.3.7/roundcubemail-1.3.7-complete.tar.gz | |
tar -xvf roundcubemail-1.3.7-complete.tar.gz | |
mv roundcubemail-1.3.7-complete roundcube | |
rm -r /usr/share/roundcube/installer |