Using WebMatrix to build a WordPress Site 2 of 2

After you finished installation PHP, MySQL and WordPress (see part 1), you will come to WebMatrix user interface with your new WordPress site:

matrix4WP11

Now you can run your website: select the “Run” button on the top and choose a browser which you like. Then the WordPress site will run at the first time:

matrix4WP12

For the first time to run WordPress site, you will have to set a site Administrator:

matrix4WP13

After you input Administrator information, and click “Install WordPress”, the WordPress will set initial stuff for your WordPress site, and finally you will see your site default face like below:

matrix4WP14

Now you can just set all things just like you set without WebMatrix before, because these settings just finished through web browser. For example, you can change Theme using web browser.

Of course, if you want to change your theme’s code, you can use WebMatrix:

Select the “File” on the left panel, and choose your file to edit:

matrix4WP15

Publish your WordPress site to Remote Hosting:

Another important feature of WebMatrix is that publish sites:

matrix4WP16

When you select Publish, you have to choose publish protocal type and input related information:

matrix4WP18

Note:

You have to choose Protocol type due to your hosting’s service, maybe your hosting only support FTP, so you have to choose FTP protocol. and you have to know FTP doesn’t support you transfer your database to hosting, FTP only support file transfer to hosting. If you want to transfer files and database, you have to choose “Web Deploy” protocol.

About Connection String: connection string like the following :

Server=SERVER_NAME;Database=DATABASE_NAME;Uid=DATABASE_USER;Password=DATABASE_PASSWORD

(The End)


WordPress Related Posts without Plugins

Add Related Posts section in your article is nice for your article reader.

The easy way is to find a plugin to install. and set a little bit to get it.

Here we have another solution, maybe you do not want to install too much plugins in your blog. So you have to change code by yourself.

Open WordPress theme’s single post template. In proper location which you think is good , to paste the following code (you might have to change some code due to your theme and requirement):

 

   1:  <!-- my code start -->
   2:  <br />
   3:  <div>
   4:  <br />
   5:  <span class="postcomment">
   6:  <?php
   7:  /list 5 post titles related to first tag on current post
   8:  $tags = wp_get_post_tags($post->ID);
   9:  if ($tags) {
  10:  ?>
  11:  <h3><?php _e('Related Posts', 'f2') ?> </h3>
  12:  <?php
  13:   $first_tag = $tags[0]->term_id;
  14:   $args=array(
  15:   'tag__in' => array($first_tag),
  16:   'post__not_in' => array($post->ID),
  17:   'showposts'=>5,
  18:   'caller_get_posts'=>1
  19:   );
  20:   $my_query = new WP_Query($args);
  21:   if( $my_query->have_posts() ) {
  22:   while ($my_query->have_posts()) : $my_query->the_post(); ?>
  23:   <h4><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
  24:  <?php the_title(); ?></a></h4>
  25:   <?php
  26:   endwhile;
  27:   }
  28:  }
  29:  ?></span>
  30:  </div>
  31:  <!-- my code end -->

Using WebMatrix to build a WordPress Site 1 of 2

What is WebMatrix? OK, it is Microsoft WebMatrix. So What is Microsoft WebMatrix then?

If you don’t know please just read the explanation from Microsoft:

WebMatrix is a free web development tool from Microsoft that includes everything you need for website development. Start from open source web applications, built-in web templates or just start writing code yourself. It’s all-inclusive, simple and best of all free. Developing websites has never been easier.

Why we recommended WebMatrix because this tool is not like Microsoft’s other tools such as Visual Studio which is only for Microsoft’s product or platform, WebMatrix is a kind of IDE tool which is not focus on some specified platform. You can use it to build a WordPress site, a Joomla site, a Drupal site and also DotNetNuke and BlogEngine.net web sites. It can get all popular open source system and let you build your site based on them.

Here we try to use Webmatrix to build a WordPress site:

1: Open WebMatrix, and choose “Site From Web Gallery”

matrix4WP00 

2: Choose “WordPress” and input your Site Name:

matrix4WP01

3: If you don’t have a MySQL installed on your computer yet, WebMatrix will ask you to install a MySQL database, we choose it install MySQL on our machine:

matrix4WP02

4: Input the administrator’s password for the database (you can see the default user name is root):

matrix4WP03

5: Matrix will install WordPress and PHP and also you have to accept EULA:

matrix4WP04

6: Matrix will download and install MySQL, PHP and WordPress for you now:

(You can see some information such as : Install PHP for Matrix, install MySQL connector/Net 6.2.3…)

matrix4WP05

(Actually when we installed MySQL in this step, we got a stuck in this step, the MySQL installation won’t go ahead, we waited long time and finally we had to cancel the install and went to Windows control panel to uninstall all MySQL stuff which have been installed finished), We don’t know whether it is a bug of WebMatrix or not. After we uninstall, for more install clear, we also rebooted our Windows 7. Fortunately the second installation we passed this step)

7: After the last step installation, We now need to create a database for WordPress. We keep all default setting but input our database passwords:

matrix4WP06

In this step you have to input 2 passwords: the first password is for database User name, the User is “wordpressuser” here, the second password is root’s password which you have set in Step 4;

Also, Please DO NOT forget to scroll down on this page, there are 4 more items you’d better fill:

matrix4WP06_1

You can input any string by yourself, or, the better is choosing security key generator from wordpress.org to generate to you.

Then we got another screen to indicate WordPress is installing:

matrix4WP07

8: Later we got the following screen which tell us what software installed successfully and what software installed failed:

matrix4WP08

We see our MySQL Windows 5.1 still installed failed because security settings. We then check the Installer Log and find help through that Get Help link. Finally we recognized the reason should be that we have installed MySQL in above Step 6, even we have uninstalled, but “only the binaries gets uninstalled from your machine. The database created remains in fact. ”(Please check the files in C:\Program Files\MySQL\MySQL Server 5.1), and check the similar case from this article;

That means: we do not need to be worried about the MySQL install failed message. our MySQL has already there, it has been installed successfully.

For confirm this, let us to try to run something in MySQL:

Go to start and find MySQL, and run MySQL Command Line Client

matrix4WP09

After input database password, please input MySQL command: Show Databases;

You can see our wordpress database has already there:

matrix4WP10

OK, our installation part done.

How to disable email notification in WordPress

If you have a WordPress blog site, you have to setup something, for example, you have to input the administrator’s email so that WordPress can send email notification to you admin email.

nowpemail00

However, after some days, when your blog site was searched by all kinds of searched engines like Google, people will visit your site. And your site will be viewed everyday, people maybe register on your site, and, the most like thing which visitors to do is writing commends for your posts. and then, each commend or each register operation will occur a notification email to send to your email account which you set. That means you will receive lots of emails everyday, finally you are mad about this trouble !

 

How can you do ? Is it possible to disable this notification emails?

The answer is Yes you can disable.

 

Solution 1: 

Use WordPress plugin.

This plugin can disable email notification when new user register. We did not try it so we don’t know whether it also can disable email when user write comments.

You can try to use this plugin.

 

Solution 2:

If you just ONLY need to disable email notification when visitor write a comment, you can change setting in WordPress directly:

Go to Settings –> Discussion, check off “Anyone posts a comment” and check off “A comment is held for moderation” for Email section:

nowpemail01

How to use Akismet plugin for your wordpress blog

Akismet plugin is a famous wordpress plugin which checks your comments against the Akismet web service to see if they look like spam or not. Now wordpress recommend to use this plugin and it is a default installed plugin when you install new version of WordPress.

You need an API key to use it. If you applied a WordPress API key before, you don’t need to apply a new API from Akismet. If you don’t have one API, and your blog is individual and not for business, you can apply a free Akismet API key from Akismet.

How to use ?

   1. Download Akismet plugin if your blog doesn’t have , then and unzip. If your blog has already installed it. go to 3.
   2. Upload the plugin file to your WordPress plugins directory inside of wp-content.
   3. Activate it from the plugins menu inside of WordPress.
   4. Your will see a message on the top to ask you Enter your API key.
   5. Forget that spam was ever a problem.

How to: Create a page to display post list under a specified category

1: Go to WP Administrate control panel -> Designe -> Theme Editor;
2: Open "Main Index Template (index.php)", copy its all content;
3: Open local text editor such as Notepad, paste copied content into text editor new file, save as your new WP page file name such as MyList.php;
4: At the top of this php file, add the following code:
<?php
/*
Template Name: MyListPage
*/
?>

"MyListPage" will be your page template name which is for your selection later when you create a new page;
5: Find "<?php if (have_posts()) : ?>";
Above this line, Add "<?php query_posts(‘showposts=20&cat=18’); ?>";
cat=18 is your specified category ID
6: FTP this php file to your remote hosting "/wp-content/themes/YOUR CURRENT THEME FOLDER NAME/;
7: Write a new page in WP, give a Title like "MyList", select page template to MyListPage, just save it;
8: Done; go to see your new page "MyList".