Skip to content

Instantly share code, notes, and snippets.

Avatar

Kingsley Felix iamkingsleyf

View GitHub Profile
View some wp functions
/* ----------------------------------------------------------------------------
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
disable wordpress self ping
View self-ping.php
/* ----------------------------------------------------------------------------
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
add featured image to wordpress feed
View feed featured image.php
View gist:1cdfa750d489039dbd89167a2dc843db
[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 Apr 20, 2018
Newspaper custom CSS
View newspaper.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;
}
View 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
-----------------------------------
View gist:425c9e92de750e48ed4f2151754ab83a
// 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 Jul 15, 2017 — forked from ryanjbonnell/wp-config.php
WordPress Config: Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
View wp-config.php
// 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 Jun 23, 2017
my newspaper quote style
View newspaper-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;
}
View gist:6866d55e5eccb70787aa63063b2842c1
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;
You can’t perform that action at this time.