Threecows
Forum Replies Created
-
Forum: Hacks
In reply to: Custom Post Text: Changing specific words in new postsPerhaps 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
In reply to: How to add divYou 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>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.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.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=https://www.valokuvaamoklik.fi" /> </head> </html>
Forum: Fixing WordPress
In reply to: PHP not displaying images from databaseAha ??
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
In reply to: PHP not displaying images from databaseStrange…
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
In reply to: PHP not displaying images from databaseI 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:
https://pastebin.com/WEiQJqfrJust 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
In reply to: PHP not displaying images from databaseI 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
In reply to: PHP not displaying images from databaseWhat 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
In reply to: PHP not displaying images from databaseI 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
In reply to: PHP not displaying images from databaseJust wandering why you use bloginfo(‘template_directory’)
Anyhow use get_bloginfo(‘template_directory’) in this case.
Forum: Fixing WordPress
In reply to: PHP not displaying images from databaseTry this:
<?php echo '<img src="' . content_url() . '/images/pic.jpg' . '" />'; ?>
Forum: Fixing WordPress
In reply to: PHP not displaying images from databaseForum: Hacks
In reply to: register_setting – textarea with line-breaksOr (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);