Support » Plugins » Hacks » Getting and showing chunk of html in widget

  • Resolved ThorHammer

    (@thorhammer)


    Hello, I have copied an “empty” widget and tried to use this to get and display a large chunk of html in one of my sidebars. Upon activating the widget I get an error on this line:
    return get_file_contents('./inc/the_large_chunk.html');

    The entire code I added in the widget “shell” is here:

    function get_thelargechunk()
        {
            return get_file_contents('./inc/the_large_chunk.html');
    }
            if(foo == bar) {
                echo "nothing";
            }
             else {
                echo get_thelargechunck();
            }
Viewing 1 replies (of 1 total)
  • Unless this is a WP specific function that I haven’t run across, you want to use file_get_contents(). That’s the PHP function.

Viewing 1 replies (of 1 total)
  • The topic ‘Getting and showing chunk of html in widget’ is closed to new replies.