Extending WordPress Revolution Slider for Cover area

Since i discovered the revolution Slider iam got a big fan of the Slider even its quite heavy load but on some pages its more than worth. But the problem as long its not a part of your theme the Slider will play only in my blog content area . So i wish to play revolutions slides even in the banner area . Socalled execute revolution Shortcodes on the single blog page and even on the frontpage slider .Where i normally chose images who should rotate.

Here a view lines of code i added to the theme frontpage theme template . To clarify i use the Blip Theme and Option Tree to setup theme options and more . Blimp is not any more maintenance so any change and upgrade i have to make myself.

<?php $sliders = ot_get_option('pxg_bliv_homepage_slider'); ?>
<div class="featured-inner flexslider">
 <ul class="slides">
 <?php 
 // ALL TIME RENDER BACKGROUND IMAGE 
 foreach ($sliders as $key => $slider) { ?>
 <li style="background-image: url('<?php echo $slider["image"] ?>')">
 <?php
 // IF REVOLUTION SLIDER 
 if (preg_match("/(?<=alias=\").*?(?=\"\])/s", $slider["title"], $result)){
 $revolID = $result[0];
 } 
 if (strpos($slider["title"],'');
 
 // RENDER ANY SHORTCODE WE FOUND IN TITEL 
 }elseif(strpos( $slider["title"], '[' ) !== false){ 
 
 echo do_shortcode($slider["title"]);
 
 // ELSE DAFULT SLider
 }else{ ?> 
 <div class="container">
 <span class="sub-title"><?php echo $slider["description"] ?></span>
 <span class="title"><?php echo $slider["title"] ?></span>
 </div>
 
 <?php } ?>
 </li> 
 <?php } ?>
 </ul>
 </div>

To explain the code , we check if a revolution slider shortcode is in the Title if so we extract the parameter and execute with do_shortcode the Slider . After we look if any other shortcode is in the Title if so we execute that . In my case i use iframe Advanced and sometime i would like to render some fancy D3 animation or Odyssey.js   in the header.  If No shortcode is found we render the default images set in the theme Settings.

this is probably not 100% foolproof but for now it works quite well. Code above is for the front-page.php but its nearly the same for the single blog post page . Below how it looks like from a test blog. header cover is with revolution slider and fully anim able from the backend . The Slider loads beforehand the default image still the Big Slider is finally loaded. This is nothing that make since for fast pages but since i seperate Blog and Main page it will not affect the blog.

Screen shot 2016-01-07 at 14.37.00

Just wrote this down to remember all the little changes for later, or if i change the theme one day. Formating of the code need to be changed to be a little bit clearer

 

Custom mode for Subway WordPress Page Builder

One of my favorite Themes with the Page Builder need a custom extension for a module . Modded it once here i logged the process to remember for future upgrades. These topic will show how to add link parameter to the icon list modul for in Theme  Page Builder. Of course you can customise the same effect with the editor and some html lines but for Clients with no html knowledge its much easier to simply fill the module form and a additional field.

Icon-List

visually high value the Icon List Module the only part i missed is to add a link to the icon .  Its quite simple by extending the json parameter for that module . You have to edit the extend-vc.php file that can be found in your subway theme folder

wp-content/theme/subway/extendvc 

All modules are here defined by va_map arrays to exend our modul we need to add some link parameter to the array definition of the Icon list you can find it around line 777 . METAMODE is only a personal marker for myself to find changed code in a plugin.

//Icon List Item METAMODE
vc_map( array(
"name" => __("Icon List Item"),
"base" => "icon_list_item",
'admin_enqueue_css' => array(get_template_directory_uri().'/css/admin/vc-extend.css'),
"icon" => "icon-wpb-icon_list_item",
"category" => __('by QODE'),
"params" => array(
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon"),
"param_name" => "icon",
"value" => $icons,
"description" => __("")
),
array(

Just add a additional textfield with link parameter inside the icon list array. After adding these part we only need to extend the part that renders the module.

Add input fields your icon-list module

array(
     "type" => "textfield",
     "holder" => "div",
     "class" => "",
     "heading" => __("Link"),
     "param_name" => "link",
      "value" => $link,
     "description" => __("")
),

To keep the Theme free for future update we will test to move the mode in our function or even better in a custom new plugin .

Full Extension for Function or WP Plugin copy & past these part below.

//Icon List Item METAMODE
vc_map( array(
"name" => __("Icon List Item"),
"base" => "icon_list_item",
'admin_enqueue_css' => array(get_template_directory_uri().'/css/admin/vc-extend.css'),
"icon" => "icon-wpb-icon_list_item",
"category" => __('by QODE'),
"params" => 
           array(
                "type" => "textfield",
                 "holder" => "div",
                 "class" => "",
                 "heading" => __("Link"),
                 "param_name" => "link",
                 "value" => $link,
                 "description" => __("")
                ),
)
) );

Now you added the additional Link Form to your module it should look like these in the Editor if you click the Pencil

Icon_List Editor

Still no link on the rendered Front page now we edit the rendering part. To edit the modul template file we need in

subway/inlcude/shortcodes.php

and add the new Link part to the Shortcode for the Icon list Shortcode part to the $html you find that around line 1353 depends on the theme version

Render the new link Icon list Shortcode

Finaly we need to change the icon list shortcode to render the link for the icon list for these we need to edit shortcodes.php

We add the additional html and extract the link attribute in the first line to make it short we only add the href part to the title
change  first function line to

extract(shortcode_atts(array("link"=>"","icon"=>"", "icon_color"=>"", "icon_background_color"=>"", "icon_border_color"=>"", "title"=>"","title_color"=>""), $atts));

and the link hmtl

$html .= '><a href="'.$link.'">'.$title.'</a></p>';

Finaly the new full shortcode for list icon will lock like below

/* Icon List Item shortcode */
/* Metamode */
if (!function_exists('icon_list_item')) {
function icon_list_item($atts, $content = null) {
	extract(shortcode_atts(array("link"=>"","icon"=>"", "icon_color"=>"", "icon_background_color"=>"", "icon_border_color"=>"", "title"=>"","title_color"=>""), $atts));
	$html = '';
	$html .= '<div class="icon_list">';
	$html .= '<!-- testlistshortcode -->';
	$html .= '<i class="'.$icon.' pull-left icon-border" ';
	if($icon_color != "" || $icon_background_color != "" || $icon_border_color != ""){
		$html .= 'style="';
		if($icon_color != ""){
			$html .= 'color:'.$icon_color.';';
		}
		if($icon_background_color != ""){
			$html .= 'background-color:'.$icon_background_color.';';
		}
		if($icon_border_color != ""){
			$html .= 'border-color:'.$icon_border_color.';';
		}
		$html .= '"';
	}
	$html .= '></i>';
	$html .= '<p';
	if($title_color != ""){
		$html .= ' style="color:'.$title_color.';"';
	}
	$html .= '><a href="'.$link.'">'.$title.'</a></p>';
	//$html .= '>'.$title.'</p>';
	$html .= '</div>';
	return $html;
}
}
add_shortcode('icon_list_item', 'icon_list_item');

 

Subway WordPress Visual Composer Update

Just a short note to the Visual Conmposer how to included link with the icon-list modul. in  he Subway WordPress Theme some nice extra functions who make it much user friendly.

The list icon modul dont support to add links , with some lines of   code we can add the option to link the Icon List item  module.

These blogpost is also a reference for later on if the theme get updated .

Following Files need to be edited you find them in subway/include and extendvc directory

Finally we mode the short code function to include the $link in short code shortcodes.php

/* Icon List Item shortcode */
/* METAMODE */
if (!function_exists('icon_list_item')) {
function icon_list_item($atts, $content = null) {
extract(shortcode_atts(array("icon"=>"", "icon_color"=>"", "icon_background_color"=>"", "icon_border_color"=>"", "title"=>"", "link"=>"","title_color"=>""), $atts));
$html = '';
$html .= '<div class="icon_list">';
$html .= '<i class="'.$icon.' pull-left icon-border" ';
if($icon_color != "" || $icon_background_color != "" || $icon_border_color != ""){
$html .= 'style="';
if($icon_color != ""){
$html .= 'color:'.$icon_color.';';
}
if($icon_background_color != ""){
$html .= 'background-color:'.$icon_background_color.';';
}
if($icon_border_color != ""){
$html .= 'border-color:'.$icon_border_color.';';
}
$html .= '"';
}
$html .= '></i>';
$html .= '<p';
if($title_color != ""){
$html .= ' style="color: '.$title_color.';"';
}
$html .= '><a href="'.$link.'">'.$title.'</a></p>';
$html .= '</div>';
return $html;
}
}

 

Add the Form Label in : qode_shortcodes_icon_list_item.php

<div class="input">
<label>Link</label>
<input name="link" id="link" value="" maxlength="100" size="55" />
</div>

We add the extra array into  our new Link in extend-vc.php to extend the parameter for //Icon List Item
vc_map( array

//Icon List Item METAMODE

vc_map( array(  .....

array(
"type" => "textfield",
"holder" => "div",
"class" => "",
"heading" => __("Link"),
"param_name" => "link",
"value" => $link,
"description" => __("")
),



 

WordPress Blog Passwort vergessen ?

Es kann öfters vorkommen das man das eine oder andere Passwort vergisst vor allem wenn man viele blogs betreibt und im sinne der Sicherheit auch seine Passwörter variiert und komplex gestaltet .

Passwort zurücksetzten in 3 min

Solle die Email mir das Passwort nicht funktionieren was durchaus vorkommen kann .Kann man in 3 Minuten ein neues Passwort setzten über die phpMYAdmin  oder MYSQL Datenbank Schnittstelle die der Webhost anbietet  mit folgendem SQL Befehl.

update wp_users set user_pass=MD5('MEINNEUESPASSWORT') where user_login='admin'

Passwort Sicherheit

Auch wenn die meisten Leute glauben wer soll schon mein Webseite hacken. Webplatz kostet Geld und vor allem für halb Illegale Aktionen werden fremde Webseiten gerne übernommen vor allem dann wenn der domain url seriös klingt  und gut gelistet ist. Das auffinden von angreifbaren WordPress Seiten ist zu einfach über die google suche und übernehmen meist Roboter die tausende Webseiten abgraben um nach Öffnungen zu suchen.

Passwort min Gross klein Schreibung  min ein Zahl + Sonderzeichen und brauchbar sind auch umlaute da viele dieser script kids tools keine Umlaute beherrschen. Warum das ganze ? Gute Webseiten werden in Brutefoce hammer Technik Dauer angegriffen um das Passwort zu erraten das über hunderte Proxy mit unterschiedlicher IP so das ein blockieren fast nicht möglich ist.

wer sind die ?

Oft sind es junge Leute aus Ländern ohne Internet recht wie z.B Indonesien Malaysia Russland Türkei .Die scripty kids verdienen sich ein gutes Taschengeld mit mass mail Versand oder Werbefunk links. Oft wird auch damit geprallt wer wie viele Webseiten manipuliert  hat ähnlich einem Gamescore rankt der beste oben.

Dies nur als kleine Ergänzung und Self reminder Mensch ist nun mal bequem und gerade am Anfang denkt man nicht wie viel Arbeit verloren geht beim Verlust eines Blogs oder wenn google die domain blockt aus Sicherheits gründen.