• Resolved sandeep4688

    (@sandeep4688)


    Hi, want to know: without function.php – would my theme work !!!

    I have been comfortable in understanding and making all the files ..like index.php, single.php, archive.php, archives.php, search.php, style.css, sidebar.php, footer.php — but I’m stuck on Function.php . I’m not enough expert to write down my own functions. What to do ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • what functions do you need?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    You don’t have to use functions.php in a theme. I didn’t for years 🙂 If you leave it blank, or out of your theme, you just won’t have custom functions.

    Thread Starter sandeep4688

    (@sandeep4688)

    Thanks @ipstenu, Is this (Ipstenu.org) working without functions.php ?

    @rvoodoo : Just wanted to know, If don’t use function.php …then what may be the pros and cons.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    No, ipstenu.org (and all my other sites) have some customization in functions.php.

    Here are some nice write ups of what it’s good for:
    http://www.mattvarone.com/wordpress/functionsphp-wordpress-themes/
    http://www.pearsonified.com/2008/05/how-to-use-wordpress-functions.php
    http://www.binarymoon.co.uk/2007/05/wordpress-tips-and-tricks-functionsphp/

    My mentality is this:

    1) Never hard code into your theme what a plugin can do
    2) Never do in a plugin what can be done in one line in functions.php
    3) Never do in functions what can be done in .htaccess
    4) Never hack core! EVER!

    An example of what’s in my functions.php:

    /* Remove curly quotes, which annoy me */
    remove_filter('comment_text', 'wptexturize');
    remove_filter('the_content', 'wptexturize');
    remove_filter('the_excerpt', 'wptexturize');
    remove_filter('the_title', 'wptexturize');
    
    /* No Frakin' Self Pings
    */
    function no_self_ping( &$links ) {
            $home = get_option( 'home' );
            foreach ( $links as $l => $link )
                    if ( 0 === strpos( $link, $home ) )
                            unset($links[$l]);
    }

    2) Never do in a plugin what can be done in one line in functions.php

    Agree totally apart from the above line, sometimes there are functions and features that could be in a plugin but are better suited in the theme, because they are specific to usage of the given theme.

    Additionally i do most of my code testing in the theme’s functions file, i personally find it easier and quicker to use and debug…. amongst other reasons …. it can always be moved into a plugin later.

    All the same, non-coders should ignore what i’ve said and stick to the advice given… 😉

    @sandeep4688
    should you find the need to add options later through a functions.php file…..you don’t need to be expert enough to make one! I have many functions in my functions.php that I have just borrowed from around the web/forum. Just a matter of cutting and pasting!

    Thread Starter sandeep4688

    (@sandeep4688)

    @ipstenu
    Your Links are quite helpful! And now, find bit easy to make and integrate functions, in functions.php :). Thanks a lot !

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    @t31os_ That’s why the ‘One Line’ is important there 🙂 I have very little in my functions.php for ipstenu.org (my other site is way more complicated and has a fugly functions).

    The credo came from this line actually:
    remove_filter('the_title', 'wptexturize');

    Someone pointed me to a weighty plugin to do the same thing, and someone else gave me that line. I was ecstatic and decided that if ONE line in a functions.php file could do it, provided I comment it correctly, I’m not using a plugin that mighht ave other conflict issues down the line.

    If I have something that’s complicated or needs lots of options or frequent tweaks, even IF it’s small code, it ends up a plugin. But that was my reaction to overkill 🙂

    @sandeep4688, good luck with functions 🙂 They’re fantastically useful.

    Thread Starter sandeep4688

    (@sandeep4688)

    @ipstenu, infact you made my way easy; if you’ve more links on functions 🙂 … I’d love to go through them also.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Google has a lot of examples 🙂

    I also downloaded a LOT of themes and studied them to get an idea what I wanted to duplicate.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Using : Without functions.php – would my theme work ?’ is closed to new replies.