• Resolved wph4

    (@wph4)


    Hi,

    Trying it out.
    I have copied this to functions.php

    <?php
        if (function_exists('zeno_font_resizer_place')) {
            zeno_font_resizer_place();
        }
    ?>

    Then, I get this error code…

    Parse error: syntax error, unexpected ‘<‘ in /public/sites/mysite/wp-content/themes/themename/functions.php on line 139

    line 139 is this <?php
    What do I need to change?

    Thanks!

    https://wordpress.org/plugins/zeno-font-resizer/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Marcel Pol

    (@mpol)

    For code that you place in functions.php you can remove the ‘<?php’ and ‘?>’
    That is for opening and closing PHP code, and switching between HTML and PHP.

    But this is really a template function. If you place it in functions.php, it will give output at a too early stage, and it will break your website (logins specifically).
    You should place it in a template file like header.php or another one, at the place in the HTML-structure where you want it.

    Really, just using the widget might be easier.

    Thread Starter wph4

    (@wph4)

    Thanks!

    I would like to have it working for the whole website.

    I am working with a child theme.

    What would be then the best solution to have it done and not overwritten with theme updates?

    Cheers!

    Plugin Author Marcel Pol

    (@mpol)

    You can add it to the header.php of your child-theme. Or just add a widget to your widget-area.
    Both methods will keep it working after a parent-theme update.

    Plugin Author Marcel Pol

    (@mpol)

    I assume you got it sorted?

    Thread Starter wph4

    (@wph4)

    Hi,

    Yes, I have put it in a widget, but it looks like it doesnot work with my theme….

    Size is changing but just for some parts ….

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

The topic ‘error code adding to functions/php’ is closed to new replies.