Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

social-sharing

How to share post?

You need to replace the URL paths with: <?php the_permalink(); ?> Also consider replacing the title or description text for each button with: <?php the_title(); ?> Here”s an example: <!– Twitter –> <a href=”http://twitter.com/share?url=<?php the_permalink(); ?>&text=<?php the_title(); ?>” target=”_blank”><img src=”http://www.simplesharebuttons.com/images/somacro/twitter.png” alt=”Twitter” /></a> This code has been tested within single.php with a standard loop.

Categories posts Tags posts, social-sharing

Keeping social share count after changing WordPress Permalinks

You would have to put the old link into the url attribute for each of the share buttons. For example: <a href=”https://twitter.com/share” class=”twitter-share-button” data-url=”https://domain.com/old-link” data-via=”your_screen_name” data-lang=”en”>Tweet</a> Twitter also has an attribute called counturl which might be worth looking at. You’ll have to do a bit of research on the others.

Categories social-sharing Tags social-sharing

How to replace URL protocol using PHP?

Simply use set_url_scheme() function. $share_image_src = wp_get_attachment_image_src( get_post_thumbnail_id(), ‘large’ ); $share_image_src = set_url_scheme( $share_image_src, ‘http’ );

Categories PHP Tags php, post-thumbnails, social-sharing

How to add social follow button to header? [closed]

Best way would be to: Create a child theme, so you can still update the base theme Modify header.php or whatever outputs the logo to output your button Add custom CSS to style/position your button (in the child theme obviously)

Categories headers Tags headers, social-sharing

add share buttons above my posts without plugins

Use This Code May Help You: add_filter(‘the_content’, ‘br_content_with_social_buttons’); function br_content_with_social_buttons($content){ $url = urlencode(get_permalink()); // Get current page title $title = str_replace(‘ ‘, ‘%20’, get_the_title()); $blog_title = get_bloginfo(‘name’); $sharebuttons=” <div id=”social-share”> <strong><span>Sharing is caring</span></strong> <i class=”fa fa-share-alt”></i>&nbsp;&nbsp; <a href=”https://www.facebook.com/sharer.php?u=”.$url.'” target=”_blank” class=”facebook”><i class=”fa fa-facebook”></i> <span>Share</span></a> <a href=”https://plus.google.com/share?url=”.$url.”” target=”_blank” class=”gplus”><i class=”fa fa-google-plus”></i> <span>+1</span></a> <a href=”https://twitter.com/intent/tweet?text=”.$title.”&amp;url=”.$url.”&amp;via=YOUR_TWITTER_HANDLE_HERE” target=”_blank” class=”twitter”><i class=”fa … Read more

Categories content Tags buttons, content, social-sharing

Social sharing is not working as expected

Your pages need to have the Open Graph meta tags required for social networks to parse the needed information & display it correctly. If you’re looking for a simple, straightforward solution to this, you should check out Complete Open Graph, a plugin I wrote to handle it. Much less bloat than something like Yoast, because … Read more

Categories social-sharing Tags social-sharing

How To Post WordPress Custom Post Types to Twitter via IFTTT

IFTTT works from RSS feed, simply including your post in wordpress RSS feed can do the trick… function add_cpt_to_loop_and_feed( $query ) { if ( is_home() && $query->is_main_query() || is_feed() ) $query->set( ‘post_type’, array( ‘post’, ‘download’ ) ); return $query; }

Categories custom-post-types Tags custom-post-types, php, plugins, social-sharing, xml-rpc

how to set social icons to product / post template (Auros theme)? [closed]

Those icons are from Font Awesome as it can be seen in the page source. You should have this tag or something that looks like this somewhere right after the opening tag: <link data-minify=”1″ rel=”stylesheet” id=”font-awesome-css” href=”https://demo2wpopal.b-cdn.net/auros/wp-content/cache/min/1/auros/wp-content/plugins/elementor/assets/lib/font-awesome/css/font-awesome.min.css?ver=1633574147″ type=”text/css” media=”all”> Try adding it either by editing the theme file directly or through some kind of plugin. … Read more

Categories posts Tags posts, social-connect, social-sharing, templates

No post image when pasting link into Facebook

It’s assumed that your images are Facebook Image Sharing Compliant in size and quality, and you are trying to share single posttype ‘post’ only from a single template (single.php), and you are storing your image as post thumbnail. The following code will grab the post thumbnail (size = large) of particular post and put that … Read more

Categories facebook Tags facebook, social-sharing

Trouble displaying featured image as thumbnail when using Facebook share

Put this in your head <?php $fb_image = wp_get_attachment_image_src(get_post_thumbnail_id( get_the_ID() ), ‘thumnail’); ?> <?php if ($fb_image) : ?> <meta property=”og:image” content=”<?php echo $fb_image[0]; ?>” /> <?php endif; ?> To test it out, you don’t have to create a new post, just paste your URL in here: https://developers.facebook.com/tools/debug Here you can the data and possibly some … Read more

Categories facebook Tags facebook, social-sharing
Older posts
Newer posts
← Previous Page1 … Page4 Page5 Page6 … Page9 Next →
+ More

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
Next Page »
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress