Skip to content

Instantly share code, notes, and snippets.

View iamkingsleyf's full-sized avatar

Kingsley Felix iamkingsleyf

View GitHub Profile
/* ----------------------------------------------------------------------------
ADD FEATURED IMAGE TO FEED
*/
function featuredtoRSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = '<div>' . get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'margin-bottom: 15px;' ) ) . '</div>' . $content;
}
return $content;
}
@iamkingsleyf
iamkingsleyf / self-ping.php
Created May 9, 2019 11:22
disable wordpress self ping
/* ----------------------------------------------------------------------------
DISABLE SELF PING
*/
//Pass the variable by reference to the function, so the function can modify the variable.
function no_self_ping (&$links) {
$home = get_option( 'home' );
foreach ( $links as $l => $link )
//Find the position of the first occurrence of a substring in a string.
//($a === $b) Identical operator. TRUE if $a is equal to $b, and they are of the same type.
if ( 0 === strpos( $link, $home ) )
@iamkingsleyf
iamkingsleyf / feed featured image.php
Created May 9, 2019 11:20
add featured image to wordpress feed
[vc_row vc_row_background=""][vc_column][jnews_hero_skew compatible_column_notice="" hero_margin="0" date_format="ago" content_filter_number_alert="" post_offset="0"][/vc_column][/vc_row][vc_row equal_height="yes" vc_row_background=""][vc_column width="1/3" offset="vc_col-lg-4 vc_col-md-6"][jnews_block_21 compatible_column_notice="" header_type="heading_1" number_post="3" post_offset="0" include_category="2321" sort_by="random" first_title="Lifestyle"][jnews_block_21 compatible_column_notice="" header_type="heading_1" number_post="3" post_offset="0" include_category="81" sort_by="random" first_title="Dental"][/vc_column][vc_column width="1/3" offset="vc_col-lg-4 vc_col-md-6 vc_col-xs-12"][jnews_block_15 compatible_column_notice="" header_type="heading_1" number_post="3" post_offset="0" include_category="1,3835" sort_by="random" first_title="Highlights"][/vc_column][vc_column width="1/3" offset="vc_col-lg-4 vc_col-md-12"][jnews_block_21 compatible_column_notice="" header_type="heading_1" number_post="3" post_o
@iamkingsleyf
iamkingsleyf / newspaper.css
Created April 20, 2018 19:43
Newspaper custom CSS
/* CUSTOM QUOTE SIZE */
.td-post-content blockquote {
background-color: #FCFCFC;
border-left: 2px solid #4db2ec;
padding: 15px 23px 0 23px;
position: relative;
top: 6px;
clear: both;
margin: 0 0 29px 0;
}
@iamkingsleyf
iamkingsleyf / mx-records
Created October 22, 2017 21:26
mx records
v=spf1 a mx ip4:107.191.45.147 include:zoho.com include:bmsend.com include:sendgrid.net ~all
v=spf1 a mx include:zoho.com include:bmsend.com ~all
v=spf1 include:abc.com include:def.com include:zoho.com ~all
-----------------------------------
@iamkingsleyf
iamkingsleyf / gist:425c9e92de750e48ed4f2151754ab83a
Created July 28, 2017 19:17
wp-config real ip with autosave
// Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
$http_x_headers = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
$_SERVER['REMOTE_ADDR'] = $http_x_headers[0];
}
// Modify AUTO SAVE INTERVAL
define( 'AUTOSAVE_INTERVAL', 300 ); // Seconds
@iamkingsleyf
iamkingsleyf / wp-config.php
Created July 15, 2017 19:20 — forked from ryanjbonnell/wp-config.php
WordPress Config: Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
// Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
$http_x_headers = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
$_SERVER['REMOTE_ADDR'] = $http_x_headers[0];
}
@iamkingsleyf
iamkingsleyf / newspaper-style
Created June 23, 2017 18:30
my newspaper quote style
/* CUSTOM QUOTE SIZE */
.td-post-content blockquote {
background-color: #FCFCFC;
border-left: 2px solid #4db2ec;
padding: 15px 23px 0 23px;
position: relative;
top: 6px;
clear: both;
margin: 0 0 29px 0;
}
server {
listen 80;
server_name example.com www.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name example.com www.example.com;