thinkoholic.com - a blog by markus nolf

Posts Tagged ‘wordpress’

[posted: Thursday, 2009-03-19] [category: technology] [tags: ]

here’s a list of useful wordpress plugins that i use to extend the functionality of this blog:

bookmark / recommend:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Live
  • MisterWong
  • MySpace
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter
[posted: Sunday, 2007-12-23] [category: technology] [tags: ]

it took me until now to start using permalinks. the main reason: in all my previous posts, i had included images manually with the relative URI — e.g. <img src="2007/12/01/test.jpg”>.
the permalink for this post is a virtual folder
www.thinkoholic.com/2007/12/23/wordpress-permalinks-and-local-images/
and so the above image is looked for under
www.thinkoholic.com/2007/12/23/wordpress-permalinks[...]/2007/12/01/test.jpg
it’s not there of course, so it won’t be displayed correctly.
the problem is similar for internal links such as <a href="gallery.php”>.

instead of correcting every single post manually, i just added the following lines to wordpress/wp-includes/formatting.php, line 28:

$curl = str_replace('src="', 'src="/', $curl);
$curl = str_replace('src="/http://', 'src="http://', $curl);
$curl = str_replace('href="', 'href="/', $curl);
$curl = str_replace('href="/http://', 'href="http://', $curl);

lines 1 and 3 add the necessary root-slash to every src and href, lines 2 and 4 remove them for all external links.

if your all of your images and/or internal pages are in a subfolder, change the first and third line accordingly:

$curl = str_replace('src="', 'src="/subfolder/', $curl);

 

bookmark / recommend:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Live
  • MisterWong
  • MySpace
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter
[posted: Friday, 2005-07-15] [category: technology] [tags: ]

just in case someone else is annoyed at the inverted comma looking like a or , and the quote signs being bent to and in wordpress 1.2*…

the “replace”-commands are located in the file wp-includes/functions-formatting.php.
the html-entities to replace are: &#8216; , &#8217; , &#8220; and &#8221;
be sure to add slashes where necessary, so you don’t screw up the code.

* yeah, still using version 1.2. it would currently take too much time to apply my layout to a wordpress theme…

[lyrics quote of the moment]
oh look now,
there you go with hope again!
dashboard confessional – carve your heart out yourself

bookmark / recommend:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Live
  • MisterWong
  • MySpace
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter