If you’re using wordpress and all of a sudden you can’t approve comments, then try deactivating the ‘Cimy Swift SMTP’ module – It worked for us!
Here is an interesting post about the 5 most interesting new features in wordpress 3.0: http://mashable.com/2010/05/10/new-features-wordpress-3/
It certainly seems to be going in the right direction – I will be interested to see what can be done with the new custom content types. This could lead to the use of wordpress for the development of richer websitse and web applications.
Now if they would only fix up what has to be the world’s most frustrating WYSWYG editor! Mind you I haven’t yet come across a web WYSWYG yet that could be described as complete.
Our client’s brief was to display their latest blog post on their main web page in a truncated form, their main web page is not part or their blog. After a little searching I came across a wordpress plugin called Get-a-Post which seemed to promise just what we required.
It will retrieve a post, and sets the post’s data up correctly so that wordpress functions like the_title() and the_content() which must normally be called from within the wordpress loop can be called by php code that is outside of the wordpress loop, this is important to us as we want to display the data on a web page which is not part of the actual wordpress blog – from a ‘random’ page.
To install the plugin, just download it, and copy get-a-post.php to the blog’s wp-content/plugins/ directory. Then goto the wordpress admin/plugins screen and activate it.
Once the plugin has been activated, its function get_a_post() can be called from any php script, if called with no parameters the latest post will be made active – perfect! Before calling it make sure to include/require ‘wp-config.php’. Here is an example script that gets the latest post’s title and content and packages it up into a div and some spans:
<?php require_once(“./wp-config.php”); ?>
<?php get_a_post(); ?>
<span class=”last_post_title”><?php the_title()?></span> – <span class=”last_post_content”>
<?php echo get_the_content(); ?>
The wordpress php function get_the_content(), when called from within the wordpress ‘loop’ will usually return the current post’s content – ‘very handy’ I hear you cry! Indeed, but all is not as simple as it may seem. If there is a <!–More–> block in the post it will not return the full text but instead will return some of the text with a link like ‘read more…’ inserted (what is displayed can be controled by an argument to the function). This is fine _unless_ you actually want to get the post’s full contents!!
Finding the answer to this seemingly simple question nearly drove me mad, but I eventually found a solution, there is a global flag called $more, setting this to 1 before calling get_the_content() or the_content() etc. will result in the <!–more–> blocks not being processed and all of the post’s text will be returned!
Address: 43 Churchgate, Wicklow, Co. Wicklow, Ireland.
Telephone: +353 87 2236429
- mktime() always uses local time zone and converts from UTC
- Estimate Solar Azimuth and Elevation given GPS position and time.
- Creating time_t value from a UTC date and time in C
- Speed up Encoding of JPEG images on Embedded System
- libjpeg example – encode JPEG to memory buffer instead of file
- Get the Subversion (SVN) URL for a file using Tortoise SVN?
- Fire-And-Forget wrapper for sending simple UDP data using boost::asio libraries
- Use PIC Timer2 not Timer0 for accurate Interval Timing on an Embedded system