Send an email to all registered users when a post is published. Simply place this code into your functions.php file.
Autor: mackopu Strana 37 z 38
This shows PHP errors for your WordPress theme. It also checks that the user i an admin and error will only be displayed if it’s true.
CODE SNIPPET:
1 2 3 4 |
if ( current_user_can( 'administrator' ) ) { define('WP_DEBUG_DISPLAY', true); @ini_set('display_errors', 1); } |
Get all image attachments from a page or post. I usually use this to show a slideshow on a page.
Pulls out all your images in your post and puts it in a separate div.
This functions checks if the user is visiting using a mobile device and returns result in true or false.
So you’ve lost your password, huh? There is a way to change it the hard way, if you can’t use the ‘forgot password’-function for whatever reason. Insert this command in to a PhpMyAdmin Sql-window.
CODE SNIPPET:
1 |
UPDATE `wp_users` SET `user_pass` = MD5('NEW_PASSWORD') WHERE `wp_users`.`user_login` =`YOUR_USER_NAME` LIMIT 1; |
This code will make it simpler to accept paypal donations.
To use it, simply place the above snippet in your functions.php file and use any of the shortcodes below.
Add a Facebook like button to a page by pasting this code where you want it. You can modify the parameters, see Facebook docs.
CODE SNIPPET:
1 |
<script src="http://connect.facebook.net/sl_SI/all.js#xfbml=1"></script><fb:like href="<?php echo get_permalink()?>"; layout="standard" show_faces="true" width="450" font="arial"></fb:like> |
Just insert the above code inside the WordPress loop, and a QR-code will be rendered for every article.
CODE SNIPPET:
1 |
<img src="http://api.qrserver.com/v1/create-qr-code/?size=500x500&data="<?php the_permalink() ?>" alt="QR Code for <?php the_title_attribute(); ?>"/> |