Facebook like and share button.
Minimal settings page (button settings, post and page type settings) and iframe based button, due to speed optimization.
Video
[youtube
https://www.youtube.com/watch?v=EA9su47_iQw]
Position settings with add_filter:
`<?php
/*
content before default: false /
add_filter( 'lana_fb_share_content_before', '__return_false' );
/*
content after default: true /
add_filter( 'lana_fb_share_content_after', '__return_true' );`
Post type settings with filter:
`/*
content before in post default: false /
add_filter( 'lana_fb_share_content_before_in_post', '__return_false' );
/*
content after in post default: true /
add_filter( 'lana_fb_share_content_after_in_post', '__return_true' );
/*
hide in post default: false /
add_filter( 'lana_fb_share_hide_in_post', '__return_false' );
?>`
Page type settings with filter:
`<?php
/*
content before in page default: false /
add_filter( 'lana_fb_share_content_before_in_page', '__return_false' );
/*
content after in page default: true /
add_filter( 'lana_fb_share_content_after_in_page', '__return_true' );
/*
hide in page default: false /
add_filter( 'lana_fb_share_hide_in_page', '__return_false' );
?>`
Page type and custom page template settings with filter:
get_page_template_slug(), example: page-contact.php
`<?php
/
content before in page template default: none /
add_filter( 'lana_fb_share_content_before_in_{template_slug}', '_return_false' );
// or
add_filter( 'lana_fb_share_content_before_in*{template_slug}', '__return_true' );
/
content after in page template default: none /
add_filter( 'lana_fb_share_content_after_in_{template_slug}', '_return_false' );
// or
add_filter( 'lana_fb_share_content_after_in*{template_slug}', '__return_true' );
/*
hide in page template default: false /
add_filter( 'lana_fb_share_hide_in_{template_slug}', '__return_false' );
?>`
Add show faces to shortcode:
`<?php
/**
- Lana Facebook Share
- add 'show faces' to shortcode
- @param $atts
- @param $layout
- @return mixed
*/
function lana_fb_share_shortcode_add_show_faces( $atts, $layout ) {
/*
only standard layout /
if ( $layout != 'standard' ) {
return $atts;
}
$atts['show_faces'] = 'true';
$atts['height'] = 60;
return $atts;
}
add_filter( 'lana_fb_share_shortcode_atts', 'lana_fb_share_shortcode_add_show_faces', 10, 2 );
?>`
Add locale to shortcode:
`<?php
/**
- Lana Facebook Share
- add 'locale' to shortcode
- @param $atts
- @return mixed
*/
function lana_fb_share_shortcode_add_locale( $atts ) {
/*
eg. hungarian language /
$atts['locale'] = 'hu_HU';
return $atts;
}
add_filter( 'lana_fb_share_shortcode_atts', 'lana_fb_share_shortcode_add_locale', 10, 1 );
?>`
Available shortcodes:
[lana_fb_share]
Facebook like and share button
[lana_fb_hide]
Hide default Facebook like and share button
Lana Codes
Lana Facebook Share