How to Install Google Analytics in WordPress for Beginners

First, we will explain why Google Analytics is important and how it can help you grow your website. After that, we will show you how to sign up for a Google Analytics account and different methods to install it on your WordPress site. Finally, we will explain how to view…

Read this article

Revealed: Why Building an Email List is so Important Today

Are you considering building an email list, but have some doubts about why it is needed? Many bloggers and business owners don’t realize the importance of building an email list when they’re first starting out. However most people usually change their mind when they see the impact email…

Read this article

How to Create an Online Restaurant Menu in WordPress (Step by Step)

Do you want to create an online restaurant menu in WordPress? Sharing your menu on your website will help convince more people to stop by your restaurant. When people can easily check out the food, drinks, and prices, they’re more likely to place an order or visit. In this…

Read this article

How to Create a Short Link in WordPress (The Easy Way)

Do you want to create short links to your WordPress blog posts or pages? Short links are useful for sharing in your emails, Facebook messages, and even text messages. In this article, we will show you how to generate short links using a plugin, and how to add the ‘Get…

Read this article

Code Guide - CSS

Syntax/* Bad CSS */ .selector, .selector-secondary, .selector[type=text] { padding:15px; margin:0px 0px 15px; background-color:rgba(0, 0, 0, 0.5); box-shadow:0px 1px 2px #CCC,inset 0 1px 0 #FFFFFF } /* Good CSS */ .selector, .selector-secondary, .selector[type="text"] { padding: 15px; margin-bottom: 15px; background-color: rgba(0,0,0,.5); box-shadow: 0…

Read this article

WordPress Get the Page ID outside the loop

If you're using pretty permalinks, get_query_var('page_id') won't work. Instead, get the queried object ID from the global $wp_query: // Since 3.1 - recommended! $page_object = get_queried_object(); $page_id = get_queried_object_id(); // "Dirty" pre 3.1 global $wp_query; $page_object = $wp_query-&…

Read this article

Get current category ID of the active page

You can try using get_the_category(): $categories = get_the_category(); $category_id = $categories[0]->cat_ID;…

Read this article

Use .htaccess to redirect HTTP to HTTPs

On Hostinger, this worked: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # BEGIN WordPress RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>…

Read this article

How To Include CSS and jQuery in my WordPress plugin?

For styles wp_register_style( 'namespace', 'http://locationofcss.com/mycss.css' ); Then use: wp_enqueue_style('namespace'); wherever you want the css to load. Scripts are as above but the quicker way for loading jquery is just to use enqueue loaded in an init for the page you want it…

Read this article

WordPress query single post by slug

From the WordPress Codex: <?php $the_slug = 'my_slug'; $args = array( 'name' => $the_slug, 'post_type' => 'post', 'post_status' => 'publish', 'numberposts' => 1 ); $my_posts = get_posts($args); if( $my_posts ) : echo 'ID on the first post found ' . $my_posts[0]->ID; endif;…

Read this article