Posts Tagged WordPress

Putting HTML and other code into your Wordpress post

The problem

Again I am not really sure why these basic things are overlooked and WordPress is impressively powerful in other areas…. The simple task was to add some html tags into my blog but I did not want them rendered… So I wanted to show HTML like (</p>
<p>
or <br />) or whatever else trips your trigger without my browser reading them like a webpage(hands off broswer).

This is no easy task apparently…. This post on the WordPress Website about Writing Code in Your Posts makes it sound so easy but it did not help me much…..other than learning these few:

< = &lt;
> = &gt;
/ = &#47;
] = &#93;
[ = &#91;
" = &#34;
' = &#39;

Using these has worked for me in post titles but I can’t get them to stay in my actual posts(post body) so I looked for something to help.


The Solution / Answer / Help

I found another Plugin to take care of my needs.  It seems there is a Plugin for everything… I am still testing this with my version(2.8.6) of WordPress but it worked… kind of… Until I find I better solution I will pass it on… The plugin is called…


Code Markup

I used version 1.3…. It was a little quirky but did work after some negotiations between the 2 of us… It could be that this is quirky because I have other Plugins installed. Whatever the case I got it to work… Read on to learn more…)


Note: I found that if I saved while in HTML mode of my post editor it worked fine.  However, if I saved in the visual mode of the the WordPress editor it would erase my html and throw in a bunch of crazy code(random HTML)… The editor just can not leave some things alone. The internal editor for WordPress makes changes to what you post when you save it… It means well but this can leave anyone frustrated. First it was <br /> tags… like I talk about in this post about Adding Line Breaks <br /> With WordPress. All of this is a bit annoying.  It did eventually (knock on wood) giving me a working post with the HTML showing up… I tested it in I am open to other options but for now this will do…  Apparently you can also add other types of code with this Plugin but I have not tried yet.


Tags: , , , , ,

Adding Line Breaks <br /> With WordPress

Overview of the Problem

What a difficult chore…. I use WordPress 2.8.6 but apparently this has been an issue with earlier versions of WordPress as well.  I noticed that there was no button to add line breaks.  Further when I tried to add them either in the visual viewer by pressing return or in the HTML viewer by adding <br />…… I could but it was later erased by the editor.  This was very frustrating because line breaks, returns, carriage, returns, or whatever you want to call them are essential to typing.  How was this overlooked?  I am not sure but I needed a solution.

The Answer

I began to search for answers….. I found some solutions but the one that worked for me was using a Plugin called “TinyMCE Advanced“.  This plugin gives you more options for your wordpress editor.  I am speaking of the interface you use to add posts.  The plugin gives you more buttons and options on that interface.  Once you have it installed (Plugins >> Add New) on your version of Wordpress follow these instructions.

1. Go to Settings and choose TinyMCE Advanced

2. At the bottom there is an advanced box.  One of the Check boxes says:

Stop removing the <p> and <br /> tags when saving and show them in the HTML editor

Check this box….

 

Problem solved… You can also add a number of other buttons.  I am currently using TinyMCE Advanced Version 3.2.4….

Here is  a link which gives some other suggestions(tricks with <p> tags) that do not involve plugins…. It is also where I got my idea to use the TinyMCE Plugin…. The other solutions I could not get to work properly but maybe one of them would be better for you.  Most of the suggestions can be found in the comments at the bottom of this post:

How to Add Extra Line Breaks in WordPress


Tags: , , , , ,

WordPress Permalinks: Getting It Right Using Windows

Finding the Right Terminology

When I first started thinking about this topic I was just surfing the web and I began to notice URLs that looked strange to me. These URLs did not list a file name.  I wondered how that could be. Examples look like:

http://dotnetofasp.net/howtoblog/2009/12/wordpress/how-to-setup-wordpress/

http://www.ikailo.com/94/url-modrewrite-workaround-iis-60/

No Filenames for post slugs / permalinks

No Filenames for post slugs / permalinks


Etc. and so on.

It took me a really long time to even know how to search for something like this.  I had no idea what this technique was called.  I searched things like “blog directories”  “weblog, no file names”  “SEO, Blogs”.  Mostly I thought that since this technique is helpful in getting your page found by search engines, I could find it on an SEO site.  As you can guess these searches returned things unrelated to what I wanted.

Finally, a bright idea… Look for a forum about blogging,  a forum about just writing a blog…. I signed up at this forum called Blogging Tips.  I put up a post and the nice British chap that runs the site was quick to respond.  Seems like a pretty good forum thus far.  This forum could help you understand how to make money on your blog but for me it answered the question above.

The name given to this technique is post slugs.  Later while searching I found another name, permalinks.  From here on out I will use the two words interchangeably.  Finally I had put a name (a couple names actually >>> permalinks and post slugs) to what I wanted but how could I use them?  How could I set up my own permalinks?


Windows and ISS Hosting Problems, Errors, Nightmares, Other Bad Words

With some reading I soon learned that my Windows hosting was not setup to handle permalinks.  For some odd reason this was not supported.  I emailed my hosting company(ixwebhosting) for some advice but was assured that it could not be done.  This was after I sent several ideas I had gotten from the WordPress website.  They talk extensively on how to use permalinks. Take a look at the section entitled “Permalinks without mod_rewrite“.  The options listed there include:

1.  Microsoft’s URL Rewrite Module

2.  PATHINFO Permalinks

3.  Custom 404 Redirects

The man from my hosting company that I talked to said it was not possible.

Well……………………………drum roll………………………………………………………………it can be done……. and I did it…………………..actually I just followed the advice of a great programmer so really I did little but copy but you can do the same…..  I used custom 404 redirects.  Below are links on how to get your permalinks working.  I have also listed some other links in case you want to do this a different way.

New Version of a 404 redirect << The link I used

Another Technique Using An isapi-rewrite 3.0 from helicontech.com << Found in this article

Allows for a real 404 page in addition to permalinks



So following the link’s suggestions I created a file to handle the 404 page not found error (wp-404-handler.php). Then I set my hosting to pickup this error and direct all 404 events to wp-404-handler.php. It works perfectly but since it has been three years since this solution, I feel like there could be a better way somewhere out there…. Still it works!!!

Tags: , , , , , , , ,

How to Setup Wordpress

Wow my first post…. This site is run by WordPress so I will discuss briefly how I set it up…..


Background (Where to host your blog….)

I use a company called http://ixwebhosting.com/ to host my projects these days. So when I discovered WordPress was available I installed it from their control panel. This makes it sound like my hosting company is offering this service but the reality is that WordPress is free. I didn’t understand all of this until I did a bit of research.  Go to WordPress.org’s About Page to get a better understanding of what it is.

One thing about having a hosting company that is good is it allows you to have your own URL for your blog. You pay the hosting company to be your own personal computer for when people type in your web address.  In a way it is kind of like having a secretary.  If someone calls your company(types in your address www.soandso.com) your secretary(hosting company) can be there to answer there questions and tell them about your company.  In order to have your blog from your own URL like

www.myname.com

you first need to have some kind of hosting with a company. Most hosting packages include php support and that is what you will need. So your files sit on their computer and whenever someone goes to your site your hosting company shows the files for you. One other thing to mention about hosts is that it would be easier if you chose a Linux based host instead of windows as the WordPress software seems to be more compatible with it. There are work arounds but as I discuss in this other post about permalinks…. windows hosting can give you some problems.


About WordPress

WordPress is a web application that utilizes php (programming language).  Really it is just a website (set of webpages) that allows you to build your own blog and it’s free.  So when I said above

I installed it from their control panel.

what that entailed was simply me pressing a button and my hosting company copying some files to a directory for me plus a few other things(creating a database and tables). Yes, all you have to do to get this up and running is simply copy over the files to your websites file directory and go…well not exactly.

For some there may be a bit more to do see the section entitledThe Ease of Installation and the wp-config.php file” for further information on what you should do to install this.

As I said, for me, my host set up some of the things for me when I pressed a button but I still had some issues.  I explain in the Installation Problems section of this article what went wrong.  These issues pertain specifically to my installation with my hosting company ixwebhosting but perhaps others can learn from my mistakes.


WordPress Themes

WordPress has many cool themes to choose from so that you can make blog quite personal and looking good. Since the default theme seemed boring I looked around and found a couple themes I liked. Basically setting the themes up is also a matter of copying your theme to a directory. Again just copy over the files and you can administer the whole site with the webpages they provide for you. Themes live in (wp-content/themes). This is in the root directory for your blog. My blog lives at:

http://dotnetofasp.net/howtoblog/

so the themes are located at:

http://dotnetofasp.net/howtoblog/wp-content/themes

This is where I started to run into problems.  It wasn’t the biggest problem but still a problem.  Below I outlined how I fixed the problem with the themes and other issues I had.


Installation Problems

My two main issues that caused me errors with my WordPress configuration were:

  • Themes not Working
  • Permalinks not Working


Themes not Working

I encountered some setup problems when I tried to use the themes that I uploaded to the themes folder. They showed up on the admin pages of my WordPress blog but whenever I tried to activate these new themes the whole website disappeared!!!! Everything…. I could not see the admin section or my blog… They were blank pages… Since they were blank I had to delete all the files and start over again so I could see the admin pages again.

The problem was I was running an older version of WordPress I found out. My hosting company had “installed” a very old version of WordPress(2.2). Basically they copied over an older set of files. Now the latest beta version is up to 2.9. something and the stable version is 2.8.6 which is what this blog is using. The moral is make sure you have the latest and greatest version before copying your files.

So I downloaded the latest version of WordPress and using FTP software(I use GlobalSCAPE) I uploaded it.

If you don’t have FTP software then you can use internet explorer to do this. Just type:

ftp://username:password@yourURL.com

into the address bar of internet explorer.  This may work for other browsers but I know it works for Internet Explorer.

I also took a look at these upgrading instructions because I wanted to make sure I did it right. However, I am happy to report this was very easy to do. A lot easier than I expected. I simply erased all the old files(except wp-config.php) and uploaded the new. The instructions tell you how to upgrade WordPress and in that case you have to save a few of the files but I just needed a brand new copy of the latest version.


Permalinks not Working

Pages Don’t Show Up – 404 Error – Not Found

What really drew me to WordPress were the permalinks.  At first I didn’t know what they were called but I had seen them URL’s on the web and knew they could be powerful for search engines.  I turned this feature on for my blog from the dashboard immediately.

The problem I had was once I got everything looking good on the homepage, my other pages weren’t showing up.  I kept getting the error message above:      Pages Don’t Show Up – 404 Error – Not Found

This was extremely frustrating. At first I thought there was not a work around for this because my hosting is Windows and apparently the feature of permalinks works better with Linux hosts. There is however a work around and I mention it on this post entitled “WordPress Permalinks: Getting It Right Using Windows“.


The Ease of Installation and the wp-config.php file

A couple times I talked about how easy this was to install. Upon reading something I ran across I had a thought. One thing my hosting company did do for me with that simple click of the button is they set up my wp-config.php file. This has your database connections in it and does not come with the files you download off the net. I tried to run WordPress without this file and it prompted me, even asking me if I wanted to create one so perhaps creating this on your own is not so bad with their wizard.

With a push of a button my database tables were also created. That is nice. If you don’t have that luxury this install could be a bit harder. Perhaps you would have to get the table definitions for the database from WordPress’s site.  Since my tables were setup for me I did not have to worry about this.  Along thing is that luckily WordPress’s site is awesome for support. Here are a few helpful links:

About the wp-config.php file (Editing-Creating-Etc.)

Installing WordPress


Final Comments

So far so good. I think WordPress and I will have a long relationship. It is simple to use and also has scalability(widgets and other add-ons people are coming up with everyday). I suggest it to anyone wanting to blog.

Tags: , , , ,