Skip to main content

Home/ Wordpress/ Group items tagged php snippets

Rss Feed Group items tagged

Michael Sturgeon

10 awesome PHP functions and snippets - StumbleUpon - 1 views

  •  
    Every web developer should keep useful code snippets in a personal library for future reference. Today, I'm showing you the 10 most useful snippets and functions I have added to my snippet library from the past 3 months.
Vernon Fowler

Add Odd/Even to Posts | WordPress Snippets - 0 views

  • To add the classes “even” and “odd” to your posts, put the following snippet in your functions.php.
awqi zar

Using Google's URL Shortener (goo.gl) in WordPress - 5 views

  •  
    The Google URL Shortener API has been released this week so I came up with a short snippet that generates short goo.gl URLs. The script is quite simple, you can paste it in your theme's functions.php file or create a plugin out of it, so without further ado:
anonymous

Kalin's Post List - 0 views

  •  
    Creates a widget, shortcode or PHP snippet for inserting dynamic, highly customizable lists of posts or pages such as related posts or table of content
Maggie Wolfe Riley

Digging Into WordPress - the book! - 4 views

  •  
    Two of my favorite web designers with super helpful blogs, Chris Coyier of CSS Tricks and Jeff Starr of Perishable Press, have just released their new collaboration! The book, "Digging Into WordPress," is now available as a PDF download, and if you buy the PDF book now, you will be eligible for a "sweet discount" on the hard copy of the book when it comes out, plus receive updates free. They've done a great job on this book, which covers setting up WordPress, anatomy of a WordPress theme, theme design and development, extending functionality including using WordPress as a CMS, working with RSS feeds, SEO, dealing with comments, and keeping your site "healthy." I already followed both of these designers before they began their collaboration, and have found countless useful tutorials, code snippets, design ideas, and much more on both of their sites - I've relied on Perishable Press as a source for great unobtrusive javascript code, and on CSS-Tricks for all kinds of other useful tools for making valid, functional, and beautiful sites. This book is bound to be a valuable reference to anyone who works with WordPress.
Anna Johansson

Add page/post slug class to menu item classes | WPreso - 0 views

  •  

    function add_slug_class_to_menu_item($output){
    $ps = get_option('permalink_structure');
    if(!empty($ps)){
    $idstr = preg_match_all('/
    foreach($matches[1] as $mid){
Vernon Fowler

Conditional Tags « WordPress Codex - 0 views

  • The Conditional Tags can be used in your Template files to change what content is displayed and how that content is displayed on a particular page depending on what conditions that page matches. For example, you might want to display a snippet of text above the series of posts, but only on the main page of your blog. With the is_home() Conditional Tag, that task is made easy.
  • is_single()  When any single Post (or attachment, or custom Post Type) page is being displayed. (False for Pages)
  •  
    Great for use with the Widget Logic plugin. A reference for all the conditional tags that help you restrict a widgets viewing.
  •  
    Warning: You can only use conditional query tags on or after the init action hook in WordPress. For themes, this means the conditional tag will never work properly if you are using it in the body of functions.php, i.e. outside of a function.
1 - 13 of 13
Showing 20 items per page