Skip to content

Instantly share code, notes, and snippets.

@wpsoul
wpsoul / gist:25cdcda01b03ce2cdc88
Created Sep 25, 2015
Nelio external image fix for Rehub theme
View gist:25cdcda01b03ce2cdc88
function get_post_thumb(){
global $post ;
if ( has_post_thumbnail($post->ID) ){
$image_url = get_post_meta( $post->ID, _nelioefi_url(), true );
if ( !$image_url || strlen( $image_url ) == 0 )
return false;
return $image_url;
}
}
View Page in Rething
[vc_row css=".vc_custom_1426083234632{margin-top: -25px !important;margin-bottom: 0px !important;}" bg_width_type="simple" rehub_container="" centered_container=""][vc_column width="1/1"][wpsm_featured fetch="4" dis_exerpt="" bottom_style="" tag="best"][/vc_column][/vc_row][vc_row css=".vc_custom_1426084160690{padding-top: 0px !important;padding-right: 50px !important;padding-bottom: 20px !important;padding-left: 50px !important;}" bg_width_type="simple" rehub_container="" centered_container=""][vc_column width="1/1"][vc_custom_heading text="SEE LATEST POSTS" font_container="tag:div|font_size:24px|text_align:center|line_height:24px" google_fonts="font_family:Montserrat%3Aregular%2C700|font_style:700%20bold%20regular%3A700%3Anormal"][vc_separator color="custom" border_width="3" sep_align="center" sep_width="40px" m_top="10px" m_bottom="35px" accent_color="#b07c01"][grid_loop_mod data_source="cat" columns="4_col" grid_type="def" orderby="date" order="DESC" post_formats="all" show="12" module_pagination="3"][/vc
@wpsoul
wpsoul / gist:c075d0f622e90b74325c
Created Jan 9, 2016
Array of country codes divided by continents
View gist:c075d0f622e90b74325c
$africa = array("DZ","AO","BJ","BW","BF","BI","CM","CV","CF","TD","KM","CG","CD","CI","DJ","EG","GQ","ER","ET","GA","GM","GH","GN","GW","KE","LS","LR","LY","MG","MW","ML","MR","MU","YT","MA","MZ","NA","NE","NG","RW","RE","SH","SN","SC","SL","SO","ZA","SD","SZ","ST","TZ","TG","TN","UG","EH","ZM","ZW");
$oceania = array("AS","AQ","AU","BV","IO","CX","CC","CK","FJ","PF","TF","GU","HM","KI","MH","FM","NR","NC","NZ","NU","NF","MP","PW","PG","PN","WS","SB","GS","TK","TO","TV","UM","VU","WF");
$europe = array("AL","AD","AT","BY","BE","BA","BG","HR","CY","CZ","DK","DD","EE","FO","FI","FR","DE","GI","GR","GG","HU","IS","IE","IM","IT","JE","LV","LI","LT","LU","MK","MT","FX","MD","MC","ME","NL","NO","PL","PT","RO","RU","SM","RS","CS","SK","SI","ES","SJ","SE","CH","UA","SU","GB","VA","AX");
$asia = array("AF","AM","AZ","BH","BD","BT","BN","KH","CN","CY","GE","HK","IN","ID","IR","IQ","IL","JP","JO","KZ","KW","KG","LA","LB","MO","MY","MV","MN","MM","NP","NT","KP","OM","PK","PS","YD","PH","QA","SA","SG","KR","LK","SY","TW",
View gist:e72f45fbcfca06bd8169
.wpsm-button.black { background: #505050; background: -moz-linear-gradient(top, #505050 0%, #101010 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #505050), color-stop(100%, #101010)); background: -webkit-linear-gradient(top, #505050 0%, #101010 100%); background: -o-linear-gradient(top, #505050 0%, #101010 100%); background: -ms-linear-gradient(top, #505050 0%, #101010 100%); background: linear-gradient(to bottom, #505050 0%, #101010 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#505050', endColorstr='#101010', GradientType=0 );
border: 1px solid #101010; }
.wpsm-button.black:active { background: #101010; background: -moz-linear-gradient(top, #101010 0%, #505050 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #101010), color-stop(100%, #505050)); background: -webkit-linear-gradient(top, #101010 0%, #505050 100%); background: -o-linear-gradient(top, #101010 0%, #505050 100%); background: -ms-linear-gradient(top,
@wpsoul
wpsoul / Tracking
Created Feb 11, 2016
Tracking in rehub on click for affiliate buttons
View Tracking
<script>
jQuery(document).ready(function($) {
'use strict';
$(".btn_offer_block").on('click', function(){
ga('send', 'event', 'Offer', 'click on offer button', document.location.href);
});
});
</script>
@wpsoul
wpsoul / gist:030627958ec48302d046
Created Feb 27, 2016
Use for adding link from offer to all post images
View gist:030627958ec48302d046
<script>
jQuery(document).ready(function($) {
if ($('.single-post .btn_offer_block').length > 0) {
var linkoffer = $('.single-post .btn_offer_block').first().attr('href');
$('img[class*="wp-image-"]').each(function(){
if($(this).parents('a').length == 1){
return;
}
else{
$(this).wrap('<a href="' + linkoffer + '" target="_blank" rel="nofollow"></a>');
View VC ROW with locator
[vc_row bg_width_type="window_width" css=".vc_custom_1469962570322{background: #0a0202 url(http://redirect.wpsoul.net/wp-content/uploads/2016/05/homemain.jpg?id=356) !important;background-position: center !important;background-repeat: no-repeat !important;background-size: cover !important;}"][vc_column width="1/6"][/vc_column][vc_column width="2/3" css=".vc_custom_1464185277813{padding-top: 0px !important;}"][vc_empty_space height="80px"][vc_custom_heading text="Example of business locator form" font_container="tag:h1|font_size:46px|text_align:center|color:%23ffffff|line_height:52px" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:900%20bold%20regular%3A900%3Anormal"][vc_empty_space height="20px"][vc_custom_heading text="Save your money. We gathered best app software for your business. Search inside categories,
compare and choose the best app to make your company grow and succeed." font_container="tag:div|
View Mega menu (3 columns + 1 column with image and custom text)
[wpsm_column size="one-fifth"]
<h4><i class="fa fa-camera-retro" aria-hidden="true"></i> Cameras and photos</h4>
[wpsm_list type="arrow" darklink="1" gap="small" hover="1"]
<ul>
<li><a href="http://rewise.wpsoul.net/top-page-with-review-list/">Camera Electronic</a></li>
<li><a href="http://rewise.wpsoul.net/top-page-with-review-list/">Camera Appereances</a></li>
<li><a href="http://rewise.wpsoul.net/top-page-with-review-list/">DSLR</a></li>
<li><a href="http://rewise.wpsoul.net/top-page-with-review-list/">Video cameras</a></li>
<li><a href="http://rewise.wpsoul.net/top-page-with-review-list/">Top cameras</a></li>
<li><a href="http://rewise.wpsoul.net/top-page-with-review-list/">Cheap cameras</a></li>
@wpsoul
wpsoul / Mega menu (2 columns + post widget from tag = 14
Created Nov 12, 2016
This is example of 2 columns of links + 1 wide column with post widget. I use here tag with ID 14
View Mega menu (2 columns + post widget from tag = 14
[wpsm_column size="one-fifth"]
<h4><i class="fa fa-camera-retro" aria-hidden="true"></i> Cameras and photos</h4>
[wpsm_list type="arrow" darklink="1" gap="small" hover="1"]
<ul>
<li><a href="http://rewise.wpsoul.net/top-page-with-review-list/">Camera Electronic</a></li>
<li><a href="http://rewise.wpsoul.net/top-page-with-review-list/">Camera Appereances</a></li>
<li><a href="http://rewise.wpsoul.net/top-page-with-review-list/">DSLR</a></li>
<li><a href="http://rewise.wpsoul.net/top-page-with-review-list/">Video cameras</a></li>
<li><a href="http://rewise.wpsoul.net/top-page-with-review-list/">Top cameras</a></li>
<li><a href="http://rewise.wpsoul.net/top-page-with-review-list/">Cheap cameras</a></li>
View Theme option redokan
{"rehub_framework_archive_layout":"","rehub_framework_category_layout":"","rehub_framework_search_layout":"","post_layout_style":"meta_outside","rehub_custom_css":"","rehub_analytics":"","rehub_analytics_header":"","rehub_enable_front_vc":"","rehub_color_schema":"","rehub_custom_color":"#54ae3f","rehub_sec_color":"#000000","rehub_btnoffer_color":"#ff4e0c","rehub_color_link":"","rehub_sidebar_left":"","rehub_body_block":"","rehub_color_background":"","rehub_background_image":"","rehub_background_repeat":"repeat","rehub_background_position":"","rehub_background_offset":"","rehub_background_fixed":"","rehub_sized_background":"","rehub_branded_bg_url":"","rehub_logo":"http:\/\/redokan.wpsoul.net\/wp-content\/uploads\/2017\/04\/logo.png","rehub_logo_pad_top":"15","rehub_logo_pad_bottom":"10","rehub_logo_retina":"","rehub_logo_retina_width":"171","rehub_logo_retina_height":"42","rehub_text_logo":"","rehub_text_slogan":"","rehub_favicon_note":"","rehub_header_style":"header_seven","rehub_logo_padseven_top":"10","hea
You can’t perform that action at this time.