Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged wordpress



Load jQuery into WordPress generated pages, the wp_enqueue_script function can be used in plugins as well. OR Add and load a new script that depends on jQuery (this will also cause it to load jQuery into the page as well).
2 1482 posted 17 years ago by selfmadepsyche
Edit functions.php and sidebar.php
2 1617 posted 17 years ago by selfmadepsyche
3 1088 posted 17 years ago by selfmadepsyche
1 1155 posted 17 years ago by selfmadepsyche
1 1427 posted 17 years ago by selfmadepsyche
1 1206 posted 17 years ago by selfmadepsyche
get_the_author_email outputs the post author’s email and the “80” is the size of the avatar image in pixels & it has to be in the loop!
0 2157 posted 17 years ago by selfmadepsyche
To display a list of your 10 most commented posts from 2008, simply paste the following code on your blog sidebar, or anywhere on your theme.
1 1280 posted 17 years ago by selfmadepsyche
paste it in wp-config.php and make sure the prefixes are right (wp_* is default) also the blogs must be installed on the same database with different prefixes. For example, you might have a primary blog with the table prefix wp_ on the database...
0 1220 posted 17 years ago by philiph
Use with (in custom.css) .sidebar_box {margin-bottom:2em; text-align:center;} You may have to adjust the width for your sidebars.
2 1833 posted 17 years ago by kristarella
The function content should work in any theme, it's just wrapped in a function wrapper for insertion into the Thesis theme.
2 1700 posted 17 years ago by kristarella
This CSS is nice to use with this function: .custom .avatar {float:left; border:3px solid #ddd; margin-right:1em;}
2 1514 posted 17 years ago by kristarella
You will probably have to hide the medium sized image.
2 1624 posted 17 years ago by kristarella
3 1489 posted 17 years ago by kristarella
This shows how to add content (in this case a linked image) to the end of a post using WordPress custom fields and the Thesis theme.
6 1983 posted 17 years ago by kristarella
To be placed inside a loop or a query
1 1413 posted 17 years ago by davebowker
3 2217 posted 17 years ago by jimmysessions
Thanks to LenK on the WP forums.
3 1406 posted 17 years ago by kristarella
Better way to echo a .current_page_item class on a list nav.
3 1581 posted 17 years ago by davebowker