damnsharp
Terugkerende gebruiker
- Lid geworden
- 6 jan 2012
- Berichten
- 1.394
Goedemorgen, paar jaar geleden heb ik wat php en css code voor het delen van linkjes gemaakt.
Het was wat kopiëren en plakken van geleende code.
Alleen nu werkt de whatsapp deel link niet meer, geen idee waarom. Op zich is die code in html niet zo ingewikkeld:
In de php code is het volgens mij behoorlijk hetzelfde en werkte jaren goed.
De foutmelding die je nu ziet: "3; url=" /> Sorry, no url redirect specified. Can`t complete request."
Wil iemand meekijken hoe ik de whatsapp url moet veranderen? Het gaat vooral om regel 62 en 82. Thanks!!:thumb:
php code
stukje css code voor diegene die erin geïnteresseerd is
Het was wat kopiëren en plakken van geleende code.
Alleen nu werkt de whatsapp deel link niet meer, geen idee waarom. Op zich is die code in html niet zo ingewikkeld:
HTML:
<a href="whatsapp://send?text=Deel via whatsapp" data-action="share/whatsapp/share" target="_blank">Delen via whatsapp</a>
In de php code is het volgens mij behoorlijk hetzelfde en werkte jaren goed.
De foutmelding die je nu ziet: "3; url=" /> Sorry, no url redirect specified. Can`t complete request."
Wil iemand meekijken hoe ik de whatsapp url moet veranderen? Het gaat vooral om regel 62 en 82. Thanks!!:thumb:
php code
PHP:
<?php
/*
Plugin Name: ShareIcons
Plugin URI:
Description: ShareIcons description
Version: 1.0
Author:
Author URI: http://crunchify.com/how-to-create-social-sharing-button-without-any-plugin-and-script-loading-wordpress-speed-optimization-goal/
License:
License URI:
*/
function add_my_css_and_my_js_files(){
wp_enqueue_style( 'your-stylesheet-name', plugins_url('/css/new-style.css', __FILE__), false, '1.0.0', 'all');
}
add_action('wp_enqueue_scripts', "add_my_css_and_my_js_files");
function delen_social_sharing_buttons($content) {
global $post;
if(is_singular() || is_home()){
// Get current page URL
$delenURL = urlencode(get_permalink());
// Get current page title
$delenTitle = str_replace( ' ', '%20', get_the_title());
// Get Post Thumbnail for pinterest
$delenThumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
// Construct sharing URL without using any script
$twitterURL = 'https://twitter.com/intent/tweet?text='.$delenTitle.'&url='.$delenURL.'&via=RomijnOfficeSupply';
$facebookURL = 'https://www.facebook.com/sharer/sharer.php?u='.$delenURL;
$whatsappURL = 'whatsapp://send?text='.$delenTitle . ' ' . $delenURL;
$linkedInURL = 'https://www.linkedin.com/shareArticle?mini=true&url='.$delenURL.'&title='.$delenTitle;
// Based on popular demand added Pinterest too
$pinterestURL = 'https://pinterest.com/pin/create/button/?url='.$delenURL.'&media='.$delenThumbnail[0].'&description='.$delenTitle;
// Add sharing button at the end of page/page content
$content .= '<!-- Delen.com social sharing. Get your copy here: http://delen.me/1VIxAsz -->';
$content .= '<div class="delen-social">';
$content .= '<h5>Deel dit via</h5> <a class="delen-link delen-twitter" href="'. $twitterURL .'" target="_blank">Twitter</a>';
$content .= '<a class="delen-link delen-facebook" href="'.$facebookURL.'" target="_blank">Facebook</a>';
$content .= '<a class="delen-link delen-whatsapp" href="'.$whatsappURL.'" target="_blank">WhatsApp</a>';
$content .= '<a class="delen-link delen-linkedin" href="'.$linkedInURL.'" target="_blank">LinkedIn</a>';
$content .= '<a class="delen-link delen-pinterest" href="'.$pinterestURL.'" data-pin-custom="true" target="_blank">Pin It</a>';
$content .= '</div>';
return $content;
}else{
// if not a post/page then don't include sharing button
return $content;
}
};
add_filter( 'the_content', 'delen_social_sharing_buttons');
stukje css code voor diegene die erin geïnteresseerd is
Code:
/* Disable WhatsApp button on Desktop */
@media screen and (min-width: 1024px) {
.delen-whatsapp {
display: none !important;
}
}
.delen-link {
padding: 2px 8px 4px 8px !important;
color: white;
font-size: 12px;
border-radius: 2px;
margin-right: 2px;
cursor: pointer;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
box-shadow: inset 0 -3px 0 rgba(0,0,0,.2);
-moz-box-shadow: inset 0 -3px 0 rgba(0,0,0,.2);
-webkit-box-shadow: inset 0 -3px 0 rgba(0,0,0,.2);
margin-top: 2px;
display: inline-block;
text-decoration: none;
}
.delen-link:hover,.delen-link:active {
color: white;
}
.delen-twitter {
background: #00aced;
}
.delen-twitter:hover,.delen-twitter:active {
background: #0084b4;
}
.delen-facebook {
background: #3B5997;
}
.delen-facebook:hover,.delen-facebook:active {
background: #2d4372;
}
.delen-googleplus {
background: #D64937;
}
.delen-googleplus:hover,.delen-googleplus:active {
background: #b53525;
}
.delen-pinterest {
background: #bd081c;
}
.delen-pinterest:hover,.delen-pinterest:active {
background: #bd081c;
}
.delen-linkedin {
background: #0074A1;
}
.delen-linkedin:hover,.delen-linkedin:active {
background: #006288;
}
.delen-whatsapp {
background: #43d854;
}
.delen-whatsapp:hover,.delen-whatsapp:active {
background: #009688;
}
.delen-social {
margin: 20px 0px 25px 0px;
-webkit-font-smoothing: antialiased;
font-size: 12px;
}