WordPress

Displaying advertisements via shortcodes
Displaying advertisements via shortcodes

Ah, I lied :). There won’t be a post about shortcodes and weather. The issue is, quite some time has passed since I wrote that shortcode, and the method for detecting cities on the weather site has changed. So now, it's unclear how to get the city ID and pass it to the shortcode to display the weather widget. And without that, as you understand, the development becomes meaningless.

I’m sure you’ve seen AdSense banners (or similar) on many WordPress blogs. In this post, I’ll explain how to do that — or at least how I would do it.

read more...

Output of the RSS feed of the second site via shortcodes in WordPress
Output of the RSS feed of the second site via shortcodes in WordPress

Greetings everyone! In this article, I’d like to show you how to use shortcodes to connect to an external site, fetch a list of latest posts via RSS, and display them in a nicely formatted block on your own site.

Honestly, the task might seem odd — why would I want links to other sites in my blog? But it’s just an example. You could also fetch exchange rates, weather forecasts for today or the week (which I’ll cover in the next post). For now, let’s stick to reading RSS and displaying the content.

read more...

Introduction to WordPress Shortcodes
Introduction to WordPress Shortcodes

Hello! This is Pavel. And first, I’d like to apologize for not posting as often as I’d like. Unfortunately (or maybe not), I’ve been very busy with work lately and don’t have time to write new articles. But as long as WordPress remains popular — articles will keep coming, at least once a week.

So, I decided to publish a series of articles dedicated to shortcodes. It’s a well-worn topic, and I’m sure you can find similar posts in almost any WP blog. But it wouldn’t be right to start with “advanced” stuff without explaining the basics. That’s why this first post is focused on the foundations and simple examples. In future articles, we’ll try to combine shortcodes with a module from one of the previous topics.

read more...

How to write a simple plugin for WordPress
How to write a simple plugin for WordPress

Hello! Although I don’t have much experience creating plugins, in this article I’d like to share an example of building a simple plugin that will:

  1. Store data in the database via the admin panel.
  2. Display that data on the front end for site visitors.

First — create a folder in /wp-content/plugins/ for the plugin. Let’s name it my-plugin.

Second — inside that folder, add a PHP file that handles the plugin logic. I usually name it the same as the folder — in this case, my-plugin.php.

read more...

The Easy Way to Connect FeedBurner to WordPress
The Easy Way to Connect FeedBurner to WordPress

Hello, this is Pavel! In this article, I want to describe a non-standard but very simple way to connect the FeedBurner service to the WordPress engine. By the way, I use this exact method on my own site.

“If you're lazy — build your own bike.” That’s been my motto while working with WP lately. I didn’t bother searching for a suitable plugin again — instead, I went to the documentation to see how to override the default feed. Unfortunately, I couldn’t find anything useful. So I had to go another route — disable the current feed and hook in the new one using wp_head.

read more...