Multilingual SEO and Content Localization for WordPress

Featured Imgs 26

Multilingual SEO and Content Localization for WordPressWordPress SEO and Multilingual SEO go together so that they reach certain crucial audiences that may or may not speak your language. There are so many people who look at WordPress blogs and reside in different nations. If you want to drive traffic to your website, you can’t miss these key demographics. According to current […]

The post Multilingual SEO and Content Localization for WordPress appeared first on WPExplorer.

Check if there is a duplicate username in MySQL database

558fe5180e0e8fc922d31c23ef84d240

Good day! I am new in vb.net and I want to detect if there is a duplicate of the record that a user will try to add. If the user adds an existing username from the database then it will show an error that the username has already been used.
Here is my code:
conn.Open()

        Dim qadd As String = "INSERT INTO tbl_user (uname, pword, ulvl) VALUES ('" & txt_uname.Text & "' , '" & txt_pword1.Text & "' , '" & txt_pword2.Text & "') ON DUPLICATE KEY UPDATE uname = ' " & txt_uname.Text & " '"
        Dim cmd As New MySqlCommand(qadd, conn)
        Dim data As MySqlDataReader = cmd.ExecuteReader
        MsgBox("User has been added!", MsgBoxStyle.Information)
        txt_uname.Clear()
        txt_pword1.Clear()
        txt_pword2.Clear()
        txt_uname.Focus()
        conn.Close()

Maps Scroll Wheel Fix

Category Image 052

This blog post by Steve Fenton came across my feeds the other day. I’d never heard of HERE maps before, but apparently they are embeddable somehow, like Google Maps. The problem is that you zoom and and out of HERE maps with the scrollwheel. So imagine you’re scrolling down a page, your cursor (or finger) ends up on the HERE map, and now you can’t continue scrolling down the page because that scrolling event is captured by the map and turns into map zooming.

Steve’s solution: put a “coverer” <div> over the map when a scroll event starts on the window, and remove it after a short delay (when scrolling “stops”). That solution resonates with me, as not only have I coded solutions like that in the past for embedded maps, we have a solution like that in place on CodePen today. On CodePen, you can resize the “preview” window, which is an <iframe> of the code you write. If you drag too swiftly, your mouse cursor (or touch event) might trigger movement off of the draggable element, possible onto the <iframe> itself. If that happens, the <iframe> will swallow the event, and the resizing you are trying to do stops working correctly. To prevent this, we put a “covered” <div> over top the <iframe> while you are dragging, and remove it when you stop dragging.

Thinking of maps though, it reminds me Brad Frost’s Adaptive Maps idea documented back in 2012. The idea is that embedding a map on a small screen mobile device just isn’t a good idea. Space is cramped, they can slow down page load, and, like Steve experienced nearly a decade later, they can mess with users scrolling through the page. Brads solution is to serve an image of a map (which can still be API-driven) conditionally for small screens with a “View Map” link that takes them to a full-screen map experience, probably within the map native app itself. Large screens can still have the interactive map, although, I might argue that having the image-that-links-to-map-service might be a smart pattern for any browser with less technical debt.


The post Maps Scroll Wheel Fix appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

How to Disable Image Attachment Pages in WordPress

Category Image 091

Do you want to disable image attachment pages in WordPress?

Image attachment pages can look like incomplete pages on your site. If a visitor views these, then it can leave a poor impression.

In this article, we’ll show you how to disable image attachment pages in WordPress and redirect it to the parent post.

How to disable image attachment pages in WordPress

Why Should You Disable Image Attachment Pages in WordPress?

By default, WordPress creates a single page for every media attachment you have on your site.

This includes images, audio/video files, pdfs, and more. Some users might find this functionality useful, however, most WordPress websites don’t need it.

For example, a photography theme could use the attachment page to display EXIF data. This could show the camera model used, the camera settings, and even the image’s location data.

Often we get complaints from users who accidentally linked their images to the attachment pages, and they don’t like the way it looks.

This is a big issue because many themes don’t have special templates for the image attachment pages.

Sometimes an image on your website can become popular, and people might start landing on the attachment page directly from Google.

Ideally, you want visitors to land on your post and see the image in the context you have used it.

This is why we always recommend users to disable image attachment pages on their WordPress blog.

How to Disable Image Attachment Pages in WordPress (2 Methods)

There are two ways to disable image attachment pages in WordPress.

The first approach uses WordPress plugins, while the second involves adding custom code to WordPress.

You’ll want to choose the method that’s best suited for your skills.

Method 1: Disable Image Attachment Pages in WordPress (with a Plugin)

The easiest way to disable image attachment pages is to use a WordPress plugin. This method is beginner friendly and requires no coding.

We recommend using All in One SEO. It’s the best SEO plugin for WordPress used by over 2 million sites.

The first thing you’ll need to do is install and activate the plugin. To do this, see our guide on how to install a WordPress plugin.

Once the plugin is installed and activated, you’ll have a new menu item called ‘All in One SEO’.

Navigate to All in One SEO » Search Appearance. Next, click the ‘Media’ navigation tab.

All in One SEO search appearance media setting

The first setting is ‘Redirect Attachment URLs’. You can disable the setting entirely, redirect to the attachment page, or the attachment parent page.

We recommend redirecting to the ‘Attachment Parent’ page. That way, when a user lands on the image attachment page, they’ll be redirected to your article instead.

All in One SEO select attachment parent

Once you select your preferred setting, make sure to click ‘Save Changes’ before exiting the screen.

If you aren’t using the All in One SEO plugin, you can still disable image attachment pages and redirect users to a parent post using a plugin called Attachment Pages Redirect.

All you have to do is install and activate the plugin. It’ll automatically start redirecting users that land on attachment pages to the parent post.

If no parent post is found, then users will be redirected to your homepage.

This plugin works out of the box and has no settings page. Simple and easy.

Method 2: Disable Image Attachment Pages in WordPress (with Code Snippet)

Another option is to add a code snippet to WordPress that accomplishes the same goal as the plugin above.

If you don’t want to use a plugin or feel that you’re already using too many WordPress plugins, then you can use this method.

First, you’ll need to create a new file in your WordPress theme folder and name it image.php. If your theme already has an image.php file, then you’ll need to edit that file instead.

After that, all you have to do is add the following code as the first line in your image.php file:

<?php wp_redirect(get_permalink($post->post_parent)); ?>

Next, you need to save the image.php file and upload it to your theme directory using FTP or your WordPress hosting control panel.

Now, when a user lands on your image attachment page, they’ll be redirected to the parent post.

We hope this article helped you disable image attachment pages in WordPress. You may also want to see our beginner’s guide to image SEO and our guide on how to fix common image issues in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Disable Image Attachment Pages in WordPress appeared first on WPBeginner.

Squarespace Tutorial: How to Build a Squarespace Website

Fotolia Subscription Monthly 4610864 Xl Stock
Compared to its competitors, Squarespace offers some of the most stylish website designs in the industry, along with a site builder made for business owners of all experience levels. The platform expands its functionality on a regular basis with user-friendly tools for social media marketing, online selling, and email marketing. In this Squarespace tutorial, we’ll walk you through how to build a website on Squarespace, from start to finish.

Visitor Analytics: WordPress Site Stats & User Analytics

Featured Imgs 29

Visitor Analytics: WordPress Site Stats & User AnalyticsDo you have a website? Of course, you do, and I can wager all my money that you want more people to find your site, hence your business. Creating a website is all fun and everything good. It’s exciting building an online space where you can share the things you’re passionate about. But building a […]

The post Visitor Analytics: WordPress Site Stats & User Analytics appeared first on WPExplorer.

10 SEO Tips for Effective Websites: Non-Obvious Tips Proven to Work

Featured Imgs 23
If you have a website and want it to be found online, you’ll have to utilize Search Engine Optimization (SEO) sooner or later. Chances are you’re already familiar with the concept of keywords and Google bots. However, with the ever-changing digital landscape, it’s hard to find relevant and trustworthy website SEO tips.

How to Control Your RSS Feeds Footer in WordPress

Wp Plugins

Do you want to customize the RSS feeds footer in WordPress?

This allows you to add custom text, links, or even advertisements below your post content in your RSS feed.

In this article, we’ll show you how to easily control your RSS feed footer in WordPress, so you can display the content you want.

Control RSS feed footer in WordPress

Why Add Content to RSS Feed Footer in WordPress?

RSS feeds offer an easier way for users to read your blog posts in their favorite feed reader apps such as Feedly.

However, RSS feeds can also be used by content scrapers to automatically steal your blog posts as soon as they are published.

Sometimes these content scrapers end up ranking higher than your original post in search engines.

To learn more, see our step by step beginners guide to preventing blog content scraping in WordPress.

Adding additional content to your RSS feed footer allows you to add backlinks to your main site and the original post at the end of each article. This can help you rank higher for your posts even if they are copied by content scrapers.

By manipulating your RSS feed footer, you can also give your readers a way to visit your WordPress blog directly from your RSS feed.

Having said that, let’s take a look at how to easily control your RSS feed footer in WordPress.

Method 1. Add Content to RSS Feed Footer Using All in One SEO

This method is easier and recommended for all WordPress users. It uses the All in One SEO plugin, which is the best WordPress SEO plugin used by over 2 million websites.

First, you need to install and activate the All in One SEO plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit All in One SEO » General Settings page and click on the ‘RSS Content’ tab.

This gives you an overview of your WordPress RSS feed settings, and your WordPress RSS feed URL.

AIOSEO RSS general settings

Under the ‘RSS Content Settings’, the first box allows you to add content before each post. The second box allows you to add content to the post footer.

Next, scroll down to the ‘RSS After Content’ section to edit your RSS feed footer.

AIOSEO default RSS footer

Right away, you’ll notice that AIOSEO automatically adds credit text with backlinks to your website in the RSS feed footer.

You can either use the text as-is, or you can add your own content and tags.

AIOSEO RSS feed footer save

Don’t forget to click ‘Save Changes’ before you exit the screen.

You can now view your RSS feed to see the changes. At the end of each article, you will be able to see content you added to your RSS feed footer.

Footer text in WordPress RSS feed

Method 2: Manually Add Content to RSS Feed Footer in WordPress

This method requires you to add code to your WordPress files. If you haven’t done this before, then check out our guide on how to copy and paste code in WordPress.

You’ll need to copy and paste the following code in your theme’s functions.php file, in a site-specific plugin, or by using the Code snippets plugin.

function wpb_feed_filter($query) {
if ($query->is_feed) {
add_filter('the_content','wpb_feed_content_filter');
add_filter('the_excerpt_rss','wpb_feed_content_filter');
}
return $query;
}
add_filter('pre_get_posts','wpb_feed_filter');
 
function wpb_feed_content_filter($content) {
// Content you want to show goes here 
$content .= '<p>Thanks for reading, check out <a href="'. get_bloginfo('url') .'">'. get_bloginfo('name') .'</a> for more awesome stuff.</p>';
return $content;
}

This code simply checks if the page requested is an RSS feed, and then filters the content to display your message in the RSS feed footer.

We hope this article helped you learn how to control your RSS feed footer in WordPress. You may also want to see our ultimate guide on how to setup All in One SEO for WordPress and our expert pick of the best WordPress RSS feed plugins.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Control Your RSS Feeds Footer in WordPress appeared first on WPBeginner.