Title: Threecows's Replies | WordPress.org

---

# Threecows

  [  ](https://wordpress.org/support/users/threecows/)

 *   [Profile](https://wordpress.org/support/users/threecows/)
 *   [Topics Started](https://wordpress.org/support/users/threecows/topics/)
 *   [Replies Created](https://wordpress.org/support/users/threecows/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/threecows/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/threecows/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/threecows/engagements/)
 *   [Favorites](https://wordpress.org/support/users/threecows/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/users/threecows/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/threecows/replies/page/2/?output_format=md)

 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Custom Post Text: Changing specific words in new posts](https://wordpress.org/support/topic/custom-post-text-changing-specific-words-in-new-posts/)
 *  [Threecows](https://wordpress.org/support/users/threecows/)
 * (@threecows)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/custom-post-text-changing-specific-words-in-new-posts/#post-2844175)
 * Perhaps this code might help you to get a start..
 * Copy the code into a new textfile and name it for instance my_plugin.php
    Upload
   it to your plugin dir and activate it.
 *     ```
       <?php
       /*
       Plugin Name: My Plugin
       */
       function my_function($text) {
       	$text=str_replace('fox','dog',$text);
       	return $text;
       }
       add_filter('the_content','my_function');
       ?>
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to add div](https://wordpress.org/support/topic/how-to-add-div/)
 *  [Threecows](https://wordpress.org/support/users/threecows/)
 * (@threecows)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/how-to-add-div/#post-2816294)
 * You might put the div in the post itself.
    Use the html tab to edit the post.
 * <div style=”background-image:url(‘myimages/myimage.jpg’); padding:10px 10px;”
   >
    …….. content of the post ……… </div>
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How could I make 301 redirection from "wp" folder to the root (my current homepa](https://wordpress.org/support/topic/after-moving-wordpress-original-folder-gives-page-not-found/)
 *  [Threecows](https://wordpress.org/support/users/threecows/)
 * (@threecows)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/after-moving-wordpress-original-folder-gives-page-not-found/#post-2789709)
 * I see now it works :).
    If you did remove index.php and/or index.html from the
   wp-folder: don’t worry! There is always a way to restore but I do not think that
   will be necessary.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How could I make 301 redirection from "wp" folder to the root (my current homepa](https://wordpress.org/support/topic/after-moving-wordpress-original-folder-gives-page-not-found/)
 *  [Threecows](https://wordpress.org/support/users/threecows/)
 * (@threecows)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/after-moving-wordpress-original-folder-gives-page-not-found/#post-2789706)
 * It is saver not to remove original files.
    You ‘d better rename index.php in 
   the “wp” folder to indexOLD.php. So you can always get back to the original files
   if needed.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How could I make 301 redirection from "wp" folder to the root (my current homepa](https://wordpress.org/support/topic/after-moving-wordpress-original-folder-gives-page-not-found/)
 *  [Threecows](https://wordpress.org/support/users/threecows/)
 * (@threecows)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/after-moving-wordpress-original-folder-gives-page-not-found/#post-2789703)
 * Add the following “redirect” code to an empty text file.
    Name it index.html 
   Upload it to the “wp” folder (NOT to the root folder!)
 *     ```
       <html>
       <head>
       <meta http-equiv="Refresh" content="0;url=http://www.valokuvaamoklik.fi" />
       </head>
       </html>
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [PHP not displaying images from database](https://wordpress.org/support/topic/php-not-displaying-images-from-database/)
 *  [Threecows](https://wordpress.org/support/users/threecows/)
 * (@threecows)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/php-not-displaying-images-from-database/#post-2748092)
 * Aha 🙂
    The button will probably show up, but you won’t see it in the mess of
   images displayed in the post… You’ll have to edit the testplugin and add br tags
   for instance. You can best edit the function “my_test_replstring”
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [PHP not displaying images from database](https://wordpress.org/support/topic/php-not-displaying-images-from-database/)
 *  [Threecows](https://wordpress.org/support/users/threecows/)
 * (@threecows)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/php-not-displaying-images-from-database/#post-2748089)
 * Strange…
    The only thing I can think of is the shortcode and the name “test” 
   is not unique enough.
 * Try this:
    In testplugin.php find and replace ALL words matching “test” with “
   myown”. (this will change the plugin name and function names as well which is
   no problem at all)
 * Upload end replace testplugin.php
    Use the shortcode [myown] in the post.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [PHP not displaying images from database](https://wordpress.org/support/topic/php-not-displaying-images-from-database/)
 *  [Threecows](https://wordpress.org/support/users/threecows/)
 * (@threecows)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/php-not-displaying-images-from-database/#post-2748070)
 * I suggest you’d better make a custom plugin instead of using this ‘php show plugin’
   for this purpose.
 * Here’s the code for the test-plugin:
    [http://pastebin.com/WEiQJqfr](http://pastebin.com/WEiQJqfr)
 * Just copy the code into a new textfile and name it testplugin.php
    Upload the
   file to your plugin directory. Activate it. Add the shortcode [test] to a post.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [PHP not displaying images from database](https://wordpress.org/support/topic/php-not-displaying-images-from-database/)
 *  [Threecows](https://wordpress.org/support/users/threecows/)
 * (@threecows)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/php-not-displaying-images-from-database/#post-2748069)
 * I installed the plugin you use for displaying php.
    Put the code in a post and
   it is indeed not printing anything. Look’s like the plugin won’t handle complicated
   strings.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [PHP not displaying images from database](https://wordpress.org/support/topic/php-not-displaying-images-from-database/)
 *  [Threecows](https://wordpress.org/support/users/threecows/)
 * (@threecows)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/php-not-displaying-images-from-database/#post-2748066)
 * What is the full path of the folder containing the images ??
 * Check things out to construct the correct URI’s :
 *     ```
       echo ABSPATH . "<br />";
       echo content_url() . "<br />";
       echo TEMPLATEPATH . "<br />";
       echo get_bloginfo('template_directory');
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [PHP not displaying images from database](https://wordpress.org/support/topic/php-not-displaying-images-from-database/)
 *  [Threecows](https://wordpress.org/support/users/threecows/)
 * (@threecows)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/php-not-displaying-images-from-database/#post-2748051)
 * I rewrote this code assuming you have a folder named “/wp-content/images” in 
   your template folder.
 *     ```
       $img_dir = TEMPLATEPATH . '/wp-content/images/' ;
       $files=glob($img_dir . '*.*');
       foreach ($files as $file) {
       	$fileinfo = getimagesize($file);
       	if ($fileinfo[0] > 0) { //it's an imagefile
       		$pathinfo = pathinfo($file);
         	 	echo '<img src="' . get_bloginfo('template_directory') . '/wp-content/images/' . $pathinfo['filename'] . '.' . $pathinfo['extension'] . '" />';
       	}
       }
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [PHP not displaying images from database](https://wordpress.org/support/topic/php-not-displaying-images-from-database/)
 *  [Threecows](https://wordpress.org/support/users/threecows/)
 * (@threecows)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/php-not-displaying-images-from-database/#post-2747977)
 * Just wandering why you use bloginfo(‘template_directory’)
 * Anyhow use get_bloginfo(‘template_directory’) in this case.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [PHP not displaying images from database](https://wordpress.org/support/topic/php-not-displaying-images-from-database/)
 *  [Threecows](https://wordpress.org/support/users/threecows/)
 * (@threecows)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/php-not-displaying-images-from-database/#post-2747930)
 * Try this:
 *     ```
       <?php echo '<img src="' . content_url() . '/images/pic.jpg' . '" />'; ?>
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [PHP not displaying images from database](https://wordpress.org/support/topic/php-not-displaying-images-from-database/)
 *  [Threecows](https://wordpress.org/support/users/threecows/)
 * (@threecows)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/php-not-displaying-images-from-database/#post-2747916)
 * [codex.wordpress.org/Function_Reference/content_url](http://codex.wordpress.org/Function_Reference/content_url)
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [register_setting – textarea with line-breaks](https://wordpress.org/support/topic/register_setting-textarea-with-line-breaks/)
 *  [Threecows](https://wordpress.org/support/users/threecows/)
 * (@threecows)
 * [14 years ago](https://wordpress.org/support/topic/register_setting-textarea-with-line-breaks/#post-2744455)
 * Or (in case you want to send is as html) transfer $message to html and the Content-
   Type can stay as it is now (text/html).
 *     ```
       $message = str_replace(array("\r\n", "\n", "\r"), "<br />", $mail_text);
       ```
   

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/users/threecows/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/threecows/replies/page/2/?output_format=md)