Thursday, March 14, 2019

How to add google analytics to blogger

Read this:

https://www.betterhostreview.com/add-google-analytics-blogger.html

Since both the blogging and analytics services are powered by Google, Blogger offers very good support to the Analytics. To add Google Analytics to Blogger, you can simply input your Google Analytics tracking ID to your Blogger account. Log on your Blogger account, go to Settings, then Other, at the very bottom of this page, you will find a Google Analytics section with a Analytics Web Property ID box.


Useful software and services

For online business, these are some useful software/services:

1. http://screencast-o-matic.com

2. http://getresponse.com

3. http://ecwid.com

4. https://www.codester.com/

5. https://payhip.com/

6. https://www.meetup.com/

7. https://www.createspace.com/



Wednesday, March 13, 2019

Submitting your site to Bing

Read this:

https://blogs.bing.com/webmaster/september-2018/Anonymous-URL-Submission-Tool-Being-Retired

You can sign up for Bing Webmaster tools here:

https://www.bing.com/toolbox/webmaster/

Here's a successful submission:


Where is the xml sitemap for your Wordpress site?

Go to Yoast's SEO plugin and click on the ? beside the Sitemap feature:


You can read more about it here:


How to claim ownership of your website via google webmaster tools

You can easily claim ownership of your website by going here:

https://www.google.com/webmasters

Choose URL prefix:


Then verify via google analytics, and by uploading a page that google gives you. You can check settings to see your verification status:






How enable adsense in wordpress

Adsense requires you to add your new website to their list:



To enable adsense in your wordpress website, you need to paste this code between the head tags:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({
          google_ad_client: "ca-pub-6220266062998622",
          enable_page_level_ads: true
     });
</script>

You should also read this:

How to insert ad code in your WordPress site

Use this plugin:

Insert Headers and Footers


Tuesday, March 12, 2019

How to find multiple analytics code on WordPress site

Read this article:

https://www.monsterinsights.com/docs/how-to-find-duplicate-google-analytics-tracking-codes-in-wordpress/

Testing your Wordpress Adsense ad

To test whether an ad will be visible if available, post this into the respective wp-insert or any ad plugin:

<img src="https://via.placeholder.com/468x60/0000ff/ffffff.png?text=TEST">

It should show a blue banner as below:


Monday, March 11, 2019

AdSense Rules

How many ads you can show on your website at any one time?

Answer:

3 Display Ads (eg Large Rectangles) + 3 Link Ads (eg Horizontal Large Links)

Remove read more links in blogs

If using GeneratePress theme:

Step 1


Step 2:



Step 3:





Some wordpress and adsense ideas




This one is ver successful and still active:



How to clear WordPress cache

If your browser appears not to implement any changes you make to your WordPress changes, eg, Cookie Law Settings, then the culprit could be W3 Total Cache plugin. You need to empty its cache:


Friday, March 8, 2019

2 Ways of accessing Word Press Posts

First way is using ajax:

//--- Hanchiang News (Ajax) ---
function getAjaxNews() {
var newsContent = '';

const apiRoot = 'http://www.hanchiangnews.com/en/wp-json';

$$.ajax({
url: apiRoot + '/wp/v2/posts/?per_page=5',
success: function(posts) {
//console.log(posts);
const objs = JSON.parse(posts);
for (let post of objs) {
newsContent += post.content.rendered;
}
$$('#id-news-content').html(newsContent);
},
error: function(err) {
console.log('Error: ', err);
}
});
}


Second way is using wp-api (WordPress REST API client):

//--- Hanchiang News (wp-api)---
function getNews() {
var newsContent = '';
//const apiRoot = 'https://hjuapp.site/wp-json';
const apiRoot = 'http://www.hanchiangnews.com/en/wp-json';
var wp = new WPAPI({ endpoint: apiRoot });
wp.posts()
.perPage(3)
.then(function(posts) {
posts.forEach(function(post) {
console.log(post.content.rendered);
newsContent += post.content.rendered;
});
$$('#id-news-content').html(newsContent);
});
}

Thursday, March 7, 2019

Getting wordpress posts using REST API

Below is a function to get the posts from a WordPress website:

function getNews() {
  const apiRoot = "https://test.site/wp-json";
  var wp = new WPAPI({ endpoint: apiRoot });
  wp.posts()
    .perPage(3)
    .then(posts => {
      posts.forEach(function(post) {
        console.log(post.content.rendered);
      });
    })
    .catch(err => {
      console.log("Error: " + err);
    });
}


You need to reference the wp api library in order to work:

<script src="wpapi/wpapi.min.js"></script>

The wpapi can be downloaded from:

http://wp-api.org/node-wpapi/


Wednesday, March 6, 2019

How to embed pdf inside Wordpress

Use Gimp to open the pdf and export as jpg.

Then insert the jpg into a new Wordpress post.

How to create multi blog wordpress

Just follow the instructions here:

https://wpblogdesigner.net/create-multiple-blog-pages-in-wordpress/

In summary:

1.  Create categories news and calendars
2.  Assign your posts to either of these categories
3. Under Appearance/Menus, assign these categories to the Categories section:


How to remove multiple background images on home page

In the default theme installation for Wordpress 2017 theme, therea are multiple background images on the home page when you scroll down. To remove them, just go to each individual page and remove the Featured Image:


How to remove multiple pages in home page

If you find multiple pages being shown on home pages, just remove it like below: