Function parameters

Forums Forums Menus Function parameters

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #114
    Anonymous
    Member

    It just gets better and better. Lovely work , thanks again!

    I was wondering what are the function parameters for this plugin to add to my theme?

    I know i have to use “if function exists etcâ€

    #2478

    Something like the following should do the trick:
    [code:3o1qqgz7]<?php
    if (function_exists(‘suckerfish’)) {
    suckerfish();
    }
    ?>[/code:3o1qqgz7]

    Note: I haven’t tested that, so don’t be suprised if I’ve made a syntax error. If it doesn’t work, let me know and I’ll fix it.

    #2479
    Anonymous
    Member

    Thanks Ryan! Do i add this to the header or in the functions.php?

    And how to use “elseâ€

    #2480

    No problem.

    What you are doing is just checking if the function exists and if it does, then inserting the suckerfish(); code and if not you continue to the next instruction.

    So … it goes in the same place as your original suckerfish(); code was – normally the header.php file.

    The functions.php file in your theme is where any functions which your theme uses are stored. So you definitely don’t need to put it there.

    In the following example, the menu will display, but if the plugin is not installed, the text “Helloâ€

    #2481
    Anonymous
    Member

    Thanks so much Ryan , you rock! This worked like a charm and exactly what i needed answered.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.