• Resolved cpetsa

    (@cpetsa)


    Hi,

    I tried to add a PHP code in a TablePress cell using:

    <?php echo “Hello world”;?>.

    Although I already downloaded and activated the ‘PHP-in-tables’ extension, when I added the above example, in the cell, it did not work. The table cell just appears blank. Can you please give me an example of a PHP code that it works on a cell?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    This PHP code should work. Make sure that the Extension is really installed and activated. In addition, you might want to try turning off the TablePress output caching, by extending the Shortcode on the page to

    [table id=123 cache_table_output=false /]
    

    Regards,
    Tobias

    Thread Starter cpetsa

    (@cpetsa)

    Thanks.

    However, if you write the PHP code in multiple lines like:

    <?php
    echo “Hello World”;
    ?>

    does not work. Is there any way to resolve this issue, cause the PHP code I want to use is more than 3 lines and it will be inefficient to try to write it in just one line.

    Thanks

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    for this, also add the Shortcode parameter

    [table id=123 cache_table_output=false convert_line_breaks=false /]
    

    Regards,
    Tobias

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

The topic ‘Example of adding a php code in a TablePress cell’ is closed to new replies.