WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] get_search_form(); is more heavier? (11 posts)

  1. Indojepang
    Member
    Posted 5 years ago #

    get_search_form(); is more heavier than include (TEMPLATEPATH . "/searchform.php"); ?

    Just curious.. thank u..

  2. Austin Matzko
    Member
    Posted 5 years ago #

    If searchform.php exists, get_search_form() will use it; otherwise it uses its own text.

    So it's probably better to use get_search_form() as it provides hooks that plugin authors can take advantage of.

  3. sampablokuper
    Member
    Posted 5 years ago #

    it's probably better to use get_search_form() as it provides hooks that plugin authors can take advantage of.

    But which hooks, and where are they documented?

  4. Austin Matzko
    Member
    Posted 5 years ago #

    The get_search_form filter. I don't know where or if it's documented, but it passes to its callbacks the default search form created in that function.

  5. sampablokuper
    Member
    Posted 5 years ago #

    The get_search_form filter. I don't know where or if it's documented, but it passes to its callbacks the default search form created in that function.

    Thanks for the reply. It turns out that it wasn't adequately documented (at least, not IMO), so I opened a ticket about it. Until the info on that ticket's thread makes it into the Codex, the ticket's page is the best documentation available for get_search_form().

  6. Justin Tadlock
    Member
    Posted 5 years ago #

    You shouldn't open tickets in Trac about the Codex. Trac is for reporting bugs.

    People can always discuss the documentation here and add it to the Codex.

  7. sampablokuper
    Member
    Posted 5 years ago #

    You shouldn't open tickets in Trac about the Codex. Trac is for reporting bugs.

    Thanks for the info, but Trac is also for requesting enhancements, features and other things. I was requesting an enhancement to the Codex.

    It has since been made clear to me by other Trac users that this is not conventional in the wordpress.org community (you might want to check out the discussion), but I continue to take a wide view of what constitutes a "bug": for me, anything that is an impediment to users being able to do what they want with the system is a "bug", whether that impediment is due to a faulty line of code or a confusing paragraph of documentation that throws the user off track. Widen your scope, I'd say :)

  8. MichaelH
    Member
    Posted 5 years ago #

    Just as a note, developers have asked that features and ideas be submitted to http://wordpress.org/extend/ideas/ rather than Trac.

    Also note the beauty of using MediaWiki for Codex means anyone can create information!

  9. Andrew cb
    Member
    Posted 4 years ago #

    May I asked you a question?

    How to WRAP the GET_SEARCH_FORM();
    If it is located inside a loop. Please pay attention at : get_search_form();

    The reason I ask you this question is for me to be able to STYLE the SEARCH BOX to be centered at the page.

    Please take a look the following:

    <?php else :
    if ( is_category() ) { // If this is a category archive
    printf("<h2 class='ccc'>Sorry, but </h2>, single_cat_title('',false));}

    else {
    echo("<h2 class='center'>no post</h2>"); }
    get_search_form();

    endif;
    ?>

    Thank you

  10. Andrew cb
    Member
    Posted 4 years ago #

    Let me rephrase my question to be clearer:
    When a "GET_SEARCH_FORM();" tag is located inside a loop, How to WRAP the GET_SEARCH_FORM(); ?

    Please remember, my question is not: <?php get_search_form(); ?>
    BUT: get_search_form();
    Because it is inside a loop

    <?php else :
    if ( is_category() ) { // If this is a category archive
    printf("<h2 class='ccc'>Sorry, but </h2>, single_cat_title('',false));}

    else {
    echo("<h2 class='center'>no post</h2>"); }
    get_search_form();

    endif;
    ?>

    Thank you

  11. justinhilles
    Member
    Posted 4 years ago #

    <?php else :
    if ( is_category() ) { // If this is a category archive
    printf("<h2 class='ccc'>Sorry, but </h2>, single_cat_title('',false));}
    
    else {
        echo("<h2 class='center'>no post</h2>"); }
        echo('<div align="center">');
        get_search_form();
        echo('</div>');
    
    endif;
    ?>

    That should align anything in that DIV center. You can also just wrap it in a

    <div id="form"> get_search_form();</div>

    *make sure this is in your loop

    and center it with just css. That would be the way I would go.

    Also if you firebug it , the form probably as a css #id anyway so you can style it through that,that will do it sitewide, but if thats what you want then your golden

Topic Closed

This topic has been closed to new replies.

About this Topic