Tagged: javascript Toggle Comment Threads | Keyboard Shortcuts

  • Frankie Jarrett 5:36 pm on April 15, 2012 Permalink | Reply
    Tags: css, , javascript, jquery, loop, ,   

    Add first and last classes to your loop without using JavaScript 

    So you’re a pixel-perfect designer who wants to keep control over your WordPress loop styles? Hell yeah! You’re already pretty cool in my book.

    You’ve probably got a fancy post separator, or a brilliant doodle to fit between your last post and the comments. Whatever the reason, you don’t have CSS class selectors for targeting the first or last posts in your archive – and you really need them.

    There are a lot of tutorials on how to achieve this with jQuery. But it’s not worth relying on JavaScript for something that can easily be done with a little PHP magic.

    First, insert this function into your functions.php file.

    Now, open up loop.php and replace post_class() with the newly created fjarrett_post_class().

    This new function accepts the same parameters as the original function, so you can use it the exact same way. The only difference will be that the first and last posts will be marked automatically with an appropriate class name. Enjoy total control. :)

    If this helped you in any way I’d love to hear about it in the comments!

     
    • joel 9:31 pm on September 11, 2012 Permalink | Reply

      thanks! this works perfect!!

    • Luis 6:08 pm on November 9, 2012 Permalink | Reply

      Great job I searched far and wide and found nothing, till I found this worked just as is thank you.

    • Nick Meagher 6:58 pm on February 26, 2013 Permalink | Reply

      Worked great! Thanks!

  • Frankie Jarrett 9:38 pm on August 18, 2011 Permalink | Reply
    Tags: android, css3, html5, , javascript, mobile   

    5 Cross-platform mobile frameworks worth considering 

    I’ve been doing a shallow dive into the development of native mobile apps. In my exploring, I’ve discovered a lot of conversation about these five mobile frameworks that seem to be speeding up development time and productivity:

    Titanium
    PhoneGap
    Rhomobile
    Corona
    Sencha Touch

    Has anyone had any experience with one or more of these?

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel