Tagged: How To Toggle Comment Threads | Keyboard Shortcuts

  • Jay Versluis 2:02 pm on February 5, 2011 Permalink | Reply
    Tags: back end, , front end, How To, ,   

    Categories: Screencast, WordPress ( 74 )

    WordPress Workflow 

    In this video we will take a look at the basics of working with WordPress. I’ll show you how to use the “back end” and the “front end” at the same time with two open browser tabs.  I will also demonstrate how a change you make to your website will become live on your front page.





     
  • Jay Versluis 7:44 am on May 18, 2009 Permalink | Reply
    Tags: , core, How To,   

    Categories: How To, WordPress ( 30 )

    How to upgrade WordPress 

    If a new stable version of WordPress is available, you’ll be prompted to upgrade at the top of the dashboard.

    Upgrading not only introduces some new (and usually cool) features to your installation, but it also protects you from hackers as security holes are being fixed. I reccomend you upgrade as soon as a new version is available.

    On some shared shoting packages, the automatic upgrade function introduced in WordPress 2.7 might not work, but it’s easy enough to do this manually. All you need is

    Once you’re looged in to your FTP account, do the following:

    • delete the wp-admin directory
    • delete the wp-includes directory
    • make sure you keep the wp-content and all other directories
    • delete all files in your root directory, except for the wp-config.php file
    • now upload everything from the new package, apart from the wp-config.php file and the wp-content directory
    • last step: go to http://www.yourdomain.com/wp-admin/upgrade.php (your new installation might work without this step, but should your database need upgrading, this will take care of it).

    You’re done – enjoy the latest WordPress 😉





     
  • Jay Versluis 9:55 am on February 27, 2009 Permalink | Reply
    Tags: , How To   

    Categories: WordPress ( 137 )

    How to add a Favicon to my website? 

    Simple!

    Follow these steps:

    • check out this fabulous free Favicon Generator: http://www.favicon.cc/
    • find or draw a picture you like
    • download the file FAVICON.ICO and copy it into your root directory
    • celebrate your new Favicon

    That’s it!





     
  • Jay Versluis 2:43 pm on February 25, 2009 Permalink | Reply
    Tags: , How To, ,   

    Categories: Themes ( 25 )

    How to shorten the_content() in WordPress Themes 

    If you’ve ever created a WordPress Theme and you’re not happy with the way it outputs text to your theme, you might be interested in a handy plugin called the_excerpt_reloaded(). You can

    • shorten the number of words being printed to screen
    • you can add a handy “Read More” or whatever link
    • allow or disallow certain HTML tags (nice!)
    • and quite a bit more.

    Have a look at

    the_excerpt_reloaded can replace any of the traditional WordPress Functions and do a lot more.

    • the_content()
    • the_excerpt()
    • the_content_rss() (depreciated and unreliable in WP version 2.7)
    • the_excerpt_rss()

    Happy Theming!





     
  • Jay Versluis 11:27 am on February 25, 2009 Permalink | Reply
    Tags: How To,   

    Categories: WordPress ( 137 )

    How to backup your WordPress database? 

    The Database is the heart of your WordPress installation. Simply backing up and restoring all your files via FTP is not enough – it only contains the actual WordPress “programme” if you will, your plugins and themes, and all your uploaded media files (like pictures). It does NOT however contain your posts, links and some of the configuration data. That’s where the MySQL Database comes into play.

    Backing up your database is as important as backing up all other data on your server, and I’m afraid to say that if your server develops a fault, you’ve got nobody else but yourself to blame.

    Having said that, here’s a plugin that will do all the hard work for your, if you (want to) know about databases or not:

    Un-zip the contents, copy it into your /wp-plugins/directory, activate the plugin and off you go. You can even schedule your backups on a daily basis and have them emailed to you for safe keeping.

    Once you’ve done this, do somethign nice for yourself. Once you’ve done that, please familiarise yourself with how to RESTORE your database:

    Let me leave you with this thought:

    Backup often – you won’t regret it!





     
  • Jay Versluis 11:08 am on February 25, 2009 Permalink | Reply
    Tags: How To, ,   

    Categories: MySQL ( 19 )

    How to restore your database? 

    The Database is the heart of your WordPress installation. Simply backing up and restoring all your files via FTP is not enough – it only contains the actual WordPress “programme” if you will, your plugins and themes, and all your uploaded media files (like pictures). It does NOT however contain your posts, links and some of the configuration data. That’s where the MySQL Database comes into play.

    For any of these articles to make sense, you need to be familiar and have access to phpMyAdmin. Your hosting provider will gladly help you our there.

    If you have a fairly small database (up to 5MB), have a look at this:

    If you database is significantly larger, you need other means of uploading and importing it. I reccomend the sue of a PHP script, as detailed here:

    One sure PHP Script is BigDump:

    Obviously, before a RESTORE actually works, you would have had to BACKUP your database (naturally). Perhaps you would like to check out this article to find out how to do this:

    http://wordpress-guru.co.uk/archives/how-to-restore-your-databasehow-to-backup-your-database/





     
  • Jay Versluis 8:52 am on February 21, 2009 Permalink | Reply
    Tags: How To, ,   

    Categories: Themes ( 25 )

    How to add a NEW THEME to your site 

    One of the most amazing things about WordPress is that you can select a completely new layout for your site at the touch of a button. It’s just as easy to upload a new theme to your library – try it out for yourself.

    Here’s what you do:

    • download and un-zip your theme, so you end up with (usually) a folder of the theme’s name
    • use an FTP client (like Filezilla) to access your webspace
    • find a directory called wp-content/themes
    • upload your entire un-zipped folder into this folder
    • log into your WordPress Site (usually at http://www.example.com/wp-admin)
    • navigate to APPEARANCE – THEMES
    • find your theme and activate it
    • sit back and enjoy your site in a new layout

    You can find plenty of free and commercial themes around the net if you google WordPress Themes.

    I’ve put together a list of good sites here.





     
  • Jay Versluis 10:52 am on February 12, 2009 Permalink | Reply
    Tags: , , , , How To, ,   

    Categories: Linux ( 96 )

    How to setup a Cron Job in Linux and Plesk 

    Wouldn’t it be great if something could be triggered even when you’re not around? Say once an hour, once a day, once a week or whenever you like in predetermined intervals?

    Then you want to do this with what’s known as a Cron Job, or Scheduled Task.

    Unfortunately, this is a bit beyond what WordPress can do, and it means getting down to the nitty gritty of the internal workings  of your server (after all, that’s where WordPress lives). Bear with me here, I’ll try my best to explain and show solutions.

    I’m using a Cron Job with Manu Flury’s excellent Photo Q Plugin. It posts one of my pictures over at http://www.versluis.com every so many hours. But for this to work properly, both the WordPress Plugin and my (Linux) server need to be setup correctly.

    Some WordPress Plugins (like Rob Felty’s Postie or Charles Johnson’s Feed WordPress) have similar functionality built in, but they rely on a visitor coming to your site at predetermined intervals. That’s not something you can control really. In most cases it works reliable enough for these plugins to work, however many others just don’t have that functionality, or require more accurate control. That’s where your Cron Job comes in.

    So what on earth is a Cron Job?

    In a nutshell, it’s a task that’s triggered at predetermined intervals. But it’s a bit like sitting in front of a Linux Prompt on your SSH connection, and all you have at your displosal is a keyboard with a black screen and white text to type in. What’s worse, your server doesn’t speak “WordPress”, or PHP for that matter. So all you can do really is to give him Linux commands.

    In all likelyhood, you probably want to call a PHP file so that WordPress does something for you (such as check if it’s time for a new post, or maybe a database backup). And you can’t just tell Linux to go to that file, becasue it wouldn’t know what to do with it. I’ve tried this without success many times over (they nearly put me in a mental institution, seriously… I can assure you I’m much better now though).

    So you need to find a command that calls your PHP file as if it were a browser. Lucky for us, the command “wget” will do the trick.

    Wget is really designed for downloading a file to your server, but it’ll work fine for triggering a PHP file, just as a browser would do. The command for calling the Photo Q file for example looks like this:

    /usr/bin/wget -O - -q -t 1 http://www.yourdomain.com/wimpq-cronpost.php

    Confused? Don’t be! Let me explain:

    • “/usr/bin/wget” tells the server where the wget command is (it’s a path to a file if you hadn’t guessed)
    • “-O – -q -t -1” are some random parameters, let’s not concern ourselves with those right now (if you really want to find out, type in “wget –help” at your SSH prompt)
    • http://www.yourdomain.com/wimpq-cronpost.php” is the actual file you want to call, just like what you’d type into your browser

    Now that we know how to call upon a PHP file from our command prompt, we need to tell our server to do this without us being there, and at what times he needs to do this. He’ll be more than happy to oblige, after all, that’s what he was designed to do.

    How to setup a Cron Job in Plesk

    I’ll focus on how to do this in Plesk 9 here, which refers to it as Scheduled Tasks (earlier versions of Plesk call it Crontab).

    Here’s how you get there:

    • from the main menu on the left, select HOME
    • select DOMAINS
    • select the DOMAIN you want to run this task on
    • under Additional Tools, select SCHEDULED TASKS
    • choose the SYSTEM USER you would like this task to be run as
    • select SCHEDULE NEW TASK

    OK, this was complicated enough to figure out – now comes the part nobody ever really talks about. It’s hard to explain, so please bear with me if I’m not making a whole lot of sense at first. In essence, you’re telling your server WHEN to do something, followed by WHAT to do.

    • Each field requires an entry. Don’t leave them blank.
    • The first tick box is to “switch on” the task. That’s what you want, unless you want to suspend the task. Tick it for now.
    • Now tell your server WHEN your task shall be run.
    • a “*” (i.e. star or asterisk) means “every”. So a star in minute would run the task “every minute”, likewise for hours and days of the month
    • You can also create the command “*/5” if you want your task run every 5 hours, every 5 days, every 5 minutes – you get the drift
    • Alternatively, put in the specific date (i.e. “Monday” and “17” for Monday at 5pm)

    After all that, you’re left with one last line, which is the actual command or task you’d like to be run.

    Like I explained above, for a PHP file to be called, use the wget command like so:

    /usr/bin/wget -O - -q -t 1 http://www.yourdomain.com/wimpq-cronpost.php

    Obviously change the path to your file, including “http://”

    Click OK on the bottom and your task should be setup. No need to reboot anything.

    If at any time you feel you want to amend the task, you can do so by just modifying the parameters, or uncheck the “run task” tickbox to suspend the task completely.

    If you want to know even MORE about Cron Jobs, check this out:

    http://www.hingham-ma.com/sendstudionx/admin/resources/tutorials/cron_intro.html

    Good Luck, and have fun 😉





     
    • Brian 5:05 pm on February 14, 2011 Permalink | Reply

      This post was not very helpful. The title is “How to setup a Cron Job *in WordPress*”. This does not seem to be any different than setting up a cron for any other PHP script, other than you’re using wget, rather than PHP directly. The title leads you to believe you explain how to setup your .php file to use pieces of WordPress and $wpdb, but your post contains no such information.

      For anyone looking to do this, all you need to do is include the /wp-load.php file in your cron file and you will have you DB Config and WPDB Class.

      • Jay Versluis 5:46 pm on February 14, 2011 Permalink | Reply

        Hi Brian,

        I’m very sorry you didn’t find the info useful – and reading back over the article I can understand why: the title is indeed misleading. I have changed it to “How to setup a cron job” because that’s what it’s about – nothing to do with WordPress.

        Thanks for contributing the wp-load.php tip – I’ll check it out!

        • Sandy Nerja 6:45 pm on December 6, 2011 Permalink | Reply

          My website takes xml feeds from local estate agents, and imports their properties to display on my holiday accommodation website. The whole thing is written in wordpress, and up to now I have been manually triggering the script that imports the rental properties from the agents sites.

          Finally I have got round to automating the process and the missing link was the wp-load.php. Use it like this at the start of your script:

          require( ‘wp-load.php’ );

          This assumes your script is in the same folder as wp-load and from then on your script acts like it has been called from WordPress.

          I hope this is useful to someone else.

    • Pranny 10:15 pm on August 8, 2011 Permalink | Reply

      That’s really helpful for me !

    • Jonas 6:43 pm on November 10, 2011 Permalink | Reply

      Thanks for the article!

      How do you prevent from someone triggering the cron job by just visiting http://www.yourdomain.com/wimpq-cronpost.php ? Is there a way to make sure only the server can trigger the task?

      • Jay Versluis 3:33 pm on November 17, 2011 Permalink | Reply

        Hmmm… good question. Since this is a public file it needs to be triggered via http. However, if you move the wimpq-cronpost.php file to somewhere above public level you should be able to trigger it via PHP from the command line queue for example – but I don’t know what the implications of the PhotoQ Plugin will be. I believe the developer said it needs to be in the root folder.

        I suppose it doesn’t really matter if you (or someone else) triggers the file more often than it needs to be called since the actual time in between automatic posts is determined via the Plugin Settings. Say you call this file every 5 minutes, but you setup PhotoQ to only post a new picture once every hour, then it will only post it once every hour.

    • Roy M J 8:37 am on January 31, 2012 Permalink | Reply

      Hi,

      I am using a plesk panel with godaddy and i cannot find how to set up a cron job. What i would like to know is whether wordpress has any plugins or set-up a cron job.

      Many thanks

      Roy M J

      • Jay Versluis 10:43 am on January 31, 2012 Permalink | Reply

        Hi Roy,

        WordPress has a built-in cron function which plugin developers can use. This however relies on somebody visiting your site regularly so it can appear to be unreliable. They do a good job for internal functions, but you can’t easily trigger a script without writing a plugin.

        Plesk calls Cron Jobs “Scheduled Tasks”, you can find those under Tools and Settings (in Hosting Provider View) or under Websites and Domains – Advanced (in Power User View).

    • taipres 2:27 am on February 14, 2012 Permalink | Reply

      The way you prevent a user from triggering your cron php script early is simply ignore all IP’s/Hosts besides your servers.

      if (getenv(HTTP_X_FORWARDED_FOR)) {
      $ipaddress = getenv(HTTP_X_FORWARDED_FOR);
      } else {
      $ipaddress = getenv(REMOTE_ADDR); }

      if($ipaddress != “1.1.1.1”){
      //do nothing
      }

      I use it on my site http://cheapvpsdeals.info for various things.

      • Jay Versluis 4:22 pm on February 16, 2012 Permalink | Reply

        Superb tip, thank you so much for sharing this. It’ll certainly come in handy 😉

    • nSathees 9:24 pm on February 20, 2012 Permalink | Reply

      @Brian: Hammered the nail on the head! Thanks for that wp_load point! That’s all I needed to know.

    • nSathees 9:33 pm on February 20, 2012 Permalink | Reply

      just a thought!

      what if I setup a php file with
      header(Location:’http://example.com’) which is my WordPress setup
      and trigger that php page via corn job.

      Would that work?

    • David Feldt 7:47 pm on September 5, 2012 Permalink | Reply

      Very useful – thanks!

  • Jay Versluis 3:13 pm on February 8, 2009 Permalink | Reply
    Tags: How To, , Yahoo Pipes   

    Categories: PHP, Plugins ( 26 )

    How to add a Facebook Group Feed 

    I’ve come acoss this the other day, comes in handy as Facebook Groups don’t have a generic RSS feed. Here’s how you can display what’s new in your favourite groups within your WordPress Site:

    1. Make sure you have your Facebook Group ID handy (it’s the last 11 or so numeric digits after the ‘groupid’ tag in the URL). Check Jason Silver’s excellent Yahoo! Pipe script:
    2. http://pipes.yahoo.com/jasonsilver/facebookgroup
    3. This will give you an option to embed as badge in various formats (WordPress, Blogger, PHP Script and many others).

    Enjoy!





     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel