iusce 10 ارسال شده در آذر 96 گزارش بازنشر ارسال شده در آذر 96 خیلی از ما کاربرای وردپرس کمتر تمایل داریم که از پوسته های پیشفرض خود وردپرس استفاده کنیم به علت اینکه حتی حداقل امکانات یک وبمستر یا مدیر وبسایتو تامین نمیکنه و مجبوریم انواع افزونه هارو نصب کنیم تا بتونیم به حداقل امکانات دسترسی داشته باشیم مثل مطالب مرتبط..مطالب محبوب...اشتراک در شبکه های اجتماعی که شاید جز اصلی ترین خواسته های هر مدیر وبسایت وردپرسی هست. توی این آموزش گذاشتن دکمه اشتراک مطالب در شبکه های اجتماعی بصورت بسیار زیبا برای شما دوستان آماده شده و البته این آموزش قراره بر روی اخرین نسخه پوسته پیشفرض وردپرس انجام بشه. بریم سر اصل مطلب..!! داخل پوشه قالب 2017 بشید و فایل function.php رو با ادیتور مناسب باز کنید و کد زیرو داخل اون قرار بدید(برای حالتی که میخواهید دکمه ها انتهای مطلب قرار بگیره): function crunchify_social_sharing_buttons($content) { global $post; if(is_singular() || is_home()){ // Get current page URL $crunchifyURL = urlencode(get_permalink()); // Get current page title $crunchifyTitle = str_replace( ' ', '%20', get_the_title()); // Get Post Thumbnail for pinterest $crunchifyThumbnail = 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='.$crunchifyTitle.'&url='.$crunchifyURL.'&via=Crunchify'; $facebookURL = 'https://www.facebook.com/sharer/sharer.php?u='.$crunchifyURL; $googleURL = 'https://plus.google.com/share?url='.$crunchifyURL; $bufferURL = 'https://bufferapp.com/add?url='.$crunchifyURL.'&text='.$crunchifyTitle; $whatsappURL = 'whatsapp://send?text='.$crunchifyTitle . ' ' . $crunchifyURL; $linkedInURL = 'https://www.linkedin.com/shareArticle?mini=true&url='.$crunchifyURL.'&title='.$crunchifyTitle; // Based on popular demand added Pinterest too $pinterestURL = 'https://pinterest.com/pin/create/button/?url='.$crunchifyURL.'&media='.$crunchifyThumbnail[0].'&description='.$crunchifyTitle; // Add sharing button at the end of page/page content $content .= '<!-- Crunchify.com social sharing. Get your copy here: http://crunchify.me/1VIxAsz -->'; $content .= '<div class="crunchify-social">'; $content .= '<h5>SHARE ON</h5> <a class="crunchify-link crunchify-twitter" href="'. $twitterURL .'" target="_blank">Twitter</a>'; $content .= '<a class="crunchify-link crunchify-facebook" href="'.$facebookURL.'" target="_blank">Facebook</a>'; $content .= '<a class="crunchify-link crunchify-whatsapp" href="'.$whatsappURL.'" target="_blank">WhatsApp</a>'; $content .= '<a class="crunchify-link crunchify-googleplus" href="'.$googleURL.'" target="_blank">Google+</a>'; $content .= '<a class="crunchify-link crunchify-buffer" href="'.$bufferURL.'" target="_blank">Buffer</a>'; $content .= '<a class="crunchify-link crunchify-linkedin" href="'.$linkedInURL.'" target="_blank">LinkedIn</a>'; $content .= '<a class="crunchify-link crunchify-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', 'crunchify_social_sharing_buttons'); حالا وارد مرحله آخر کارمون میشیم و فایل style.css قالبو باز میکنیم و کد زیرو داخل اون و در جای مناسب قرار میدیم( من این کدو داخل فایلrtl قالبم قراردادم): /* Disable WhatsApp button on Desktop - Tutorial link: http://crunchify.me/1VIxAsz */ @media screen and (min-width: 1024px) { .crunchify-whatsapp { display: none !important; } } .crunchify-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; } .crunchify-link:hover,.crunchify-link:active { color: white; } .crunchify-twitter { background: #00aced; } .crunchify-twitter:hover,.crunchify-twitter:active { background: #0084b4; } .crunchify-facebook { background: #3B5997; } .crunchify-facebook:hover,.crunchify-facebook:active { background: #2d4372; } .crunchify-googleplus { background: #D64937; } .crunchify-googleplus:hover,.crunchify-googleplus:active { background: #b53525; } .crunchify-buffer { background: #444; } .crunchify-buffer:hover,.crunchify-buffer:active { background: #222; } .crunchify-pinterest { background: #bd081c; } .crunchify-pinterest:hover,.crunchify-pinterest:active { background: #bd081c; } .crunchify-linkedin { background: #0074A1; } .crunchify-linkedin:hover,.crunchify-linkedin:active { background: #006288; } .crunchify-whatsapp { background: #43d854; } .crunchify-whatsapp:hover,.crunchify-whatsapp:active { background: #009688; } .crunchify-social { margin: 20px 0px 25px 0px; -webkit-font-smoothing: antialiased; font-size: 12px; } کار تمومه و ازش لذت ببرین... (نمونه در این سایت موجوده: http://inn-arco.ir/) منبع: خلاقیت در معماری و عمران حالا یه پلاگین از پلاگینای شما حذف شد.. نقل قول لینک به ارسال
iusce 10 ارسال شده در آذر 96 مالک گزارش بازنشر ارسال شده در آذر 96 یه نکترو یادم رفت یه شبکه اجتماعی هست به اسم bufferapp.com که میخوام اینو حذف و جاش اشتراک در تلگرامو اضافه کنم پس بدقت دنبال کنید: در 3 دقیقه قبل، iusce گفته است : $bufferURL = 'https://bufferapp.com/add?url='.$crunchifyURL.'&text='.$crunchifyTitle; کد بالارو حذف و جاش این کدو بذارید: $telegramURL = 'https://t.me/share/url?url='.$crunchifyTitle.'&text='.$crunchifyURL; در 4 دقیقه قبل، iusce گفته است : $content .= '<a class="crunchify-link crunchify-buffer" href="'.$bufferURL.'" target="_blank">Buffer</a>'; کد بالارو حذف کنید و جاش اینو بزارید: $content .= '<a class="crunchify-link crunchify-telegram" href="'.$telegramURL.'" target="_blank">Telegram</a>'; حالا ظاهرشو اصلاح میکنیم(وارد استایل شیت قالب بشید) کد زیرو حذف کنید: در 6 دقیقه قبل، iusce گفته است : .crunchify-buffer { background: #444; } .crunchify-buffer:hover,.crunchify-buffer:active { background: #222; } اینو جاش بزارید: .crunchify-telegram { background: #00aced; } .crunchify-telegram:hover,.crunchify-telegram:active { background: #0084b4; } نقل قول لینک به ارسال
پست های پیشنهاد شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .