• Resolved zibko

    (@zibko)


    I want to my web page include a table with 300 lines. Each row will change only certain parameters.

    I want to do the following:
    First to define line – insert in header.php in my themes:

    <?php function fotogalerija($povezava, $slika)
    { print '<tr><td class=galerija_slika>
    <a href="http://galerija.smucka.com/categories.php?cat_id='.$povezava.'"><img src="/foto/'.$slika.'/prva_s.jpg" width=340 height=120></a>
    </td></tr></table>'; } ?>

    Then call this – i want insert in admin, where I create new page:

    <?php fotogalerija("60","slo/maze12"); ?>
    <?php fotogalerija("61","slo/jerman5"); ?>
    <?php fotogalerija("62","tuj/ahonen3"); ?>

    Problem is, that this not work. Know Somebody how to solve problem. It is possible also to include in news?

    In normal page (no WordPress) function fotogalerija work normally!

    Thanks you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • First, don’t put your function in header.php. Functions belong in functions.php.

    Second, the correct function is:

    function fotogalerija($povezava, $slika)
    {
    echo '<tr><td class=galerija_slika><a href="http://galerija.smucka.com/categories.php?cat_id='.$povezava.'"><img src="/foto/'.$slika.'/prva_s.jpg" width=340 height=120></a>
    </td></tr></table>';
    }

    This will give you a function you can call on your page templates. Unfortunately, you cannot call the function directly in post or page content. You need to edit the page template (the code that generates the page) in order to use a function like this. If you want to execute php code in the content section of a post or page, you need to install the following plugin:
    http://wordpress.org/extend/plugins/exec-php/

    This will allow you to execute php code directly.

    Thread Starter zibko

    (@zibko)

    Thanks you! It works!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘300 line table in “page”’ is closed to new replies.