Osclass Support Forums

Osclass plugin support => Blog and News Plugin => Topic started by: Ghany on May 10, 2020, 08:05:11 AM

Title: Social share Osclass blog
Post by: Ghany on May 10, 2020, 08:05:11 AM
is that possible to add social sharing options on the blog to share in social media easily?
and while sharing to social media, the link was not displaying the pic of an article, instead of blog main pic, a favicon is reflecting .. how to get blog main pic in the link?
Title: Re: Social share Osclass blog
Post by: MB Themes on May 11, 2020, 08:20:19 AM
@abdul
You may use code from your theme to create sharing buttons.
File that generates article:
oc-content/plugins/blog/form/article.php
Title: Re: Social share Osclass blog
Post by: Ajit Sahane on July 14, 2020, 05:38:52 PM
Add below code in article.php

<!-- Facebook --> Share to -
<a href="whatsapp://send?text=<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" target="_blank"> WhatsApp <i class="fa fa-whatsapp"></i></a>

<a href="https://www.facebook.com/sharer.php?u=<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" target="_blank" rel="noopener noreferrer nofollow"> FaceBook <i class="fa fa-facebook-square"></i></a>

<!-- Twitter -->
<a href="https://twitter.com/share?url=<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>&text=Blog Article&hashtags=nearmeadsblogarticle" target="_blank" rel="noopener noreferrer nofollow">Twitter <i class="fa fa-twitter"></i></a>

<!-- Digg -->
<a href="https://www.digg.com/submit?url=<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" target="_blank" rel="noopener noreferrer nofollow">Digg <i class="fa fa-digg" aria-hidden="true"></i></a>

<!-- Reddit -->
<a href="https://reddit.com/submit?url=<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>&title=Blog Article" target="_blank" rel="noopener noreferrer nofollow">Reddit <i class="fa fa-reddit" aria-hidden="true"></i></a>

<!-- LinkedIn -->
<a href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" target="_blank">LinkedIn <i class="fa fa-linkedin" aria-hidden="true"></i></a>

<!-- StumbleUpon-->
<a href="https://www.stumbleupon.com/submit?url=<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>&title=Blog Article" target="_blank" rel="noopener noreferrer nofollow">StumbleUpon <i class="fa fa-stumbleupon" aria-hidden="true"></i> </a>
Title: Re: Social share Osclass blog
Post by: Ghany on July 15, 2020, 12:06:24 AM
Add below code in article.php

<!-- Facebook --> Share to -
<a href="whatsapp://send?text=<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" target="_blank"> WhatsApp <i class="fa fa-whatsapp"></i></a>

<a href="https://www.facebook.com/sharer.php?u=<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" target="_blank" rel="noopener noreferrer nofollow"> FaceBook <i class="fa fa-facebook-square"></i></a>

<!-- Twitter -->
<a href="https://twitter.com/share?url=<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>&text=Blog Article&hashtags=nearmeadsblogarticle" target="_blank" rel="noopener noreferrer nofollow">Twitter <i class="fa fa-twitter"></i></a>

<!-- Digg -->
<a href="https://www.digg.com/submit?url=<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" target="_blank" rel="noopener noreferrer nofollow">Digg <i class="fa fa-digg" aria-hidden="true"></i></a>

<!-- Reddit -->
<a href="https://reddit.com/submit?url=<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>&title=Blog Article" target="_blank" rel="noopener noreferrer nofollow">Reddit <i class="fa fa-reddit" aria-hidden="true"></i></a>

<!-- LinkedIn -->
<a href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" target="_blank">LinkedIn <i class="fa fa-linkedin" aria-hidden="true"></i></a>

<!-- StumbleUpon-->
<a href="https://www.stumbleupon.com/submit?url=<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>&title=Blog Article" target="_blank" rel="noopener noreferrer nofollow">StumbleUpon <i class="fa fa-stumbleupon" aria-hidden="true"></i> </a>
Thank you sir