Title: Plugin Writing Issues
Last modified: August 18, 2016

---

# Plugin Writing Issues

 *  [vulturo](https://wordpress.org/support/users/vulturo/)
 * (@vulturo)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/plugin-writing-issues/)
 * Hi I’m a relative wordpress newbie. I’m trying to write my own plugin for purely
   for my own purposes. I’m trying to define a function which returns a block of
   html which can be called anywhere in a page…
 * here goes my plugin:
    `<?php /* Plugin Name: Blog Mela Version: 1.0 Author: Saket
   Vaidya Author URI: http://www.vulturo.com Description: Bharateeya Blog Mela */
 * function get_blogmela() {
    echo "<ul> <li> <a href="[http://calamur.org/gargi/2005/06/18/bharateeya-blogmela-a-round-up/">Current](http://calamur.org/gargi/2005/06/18/bharateeya-blogmela-a-round-up/">Current)
   Blog Mela</a></li> <li><a href="[http://www.madhoo.com/archives/003267.php">Next](http://www.madhoo.com/archives/003267.php">Next)
   Blog Mela</a></li> </ul>"; }
 * ?>
 * But If I try to activate this plugin, It messes up my admin panel… and messes
   up all the pages where the “get_blogmela” function has been called.
 * The issue is, the same thing works If I don’t supply links in the html blocks.
   For example.. this works:
 * `<?php
    /* Plugin Name: Blog Mela Version: 1.0 Author: Saket Vaidya Author URI:
   http://www.vulturo.com Description: Bharateeya Blog Mela */
 * function get_blogmela() {
    echo "<ul> <li> Plain Text</li> <li>More Plain Text
   </li> </ul>"; }
 * ?>
 * Its funny, if the HTML block has hyperlinks, the plugin won’t work… it will work
   if it has plain text only.
 * Can someone suggest a remedy?

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

 *  Thread Starter [vulturo](https://wordpress.org/support/users/vulturo/)
 * (@vulturo)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/plugin-writing-issues/#post-223390)
 * Also…. The error is “unexpected T_string on some line in blogmela.php (the name
   of the plugin)” if I include the hyperlinks
 *  [skippy](https://wordpress.org/support/users/skippy/)
 * (@skippy)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/plugin-writing-issues/#post-223391)
 * `<?php
    /* Plugin Name: Blog Mela Version: 1.0 Author: Saket Vaidya Author URI:
   http://www.vulturo.com Description: Bharateeya Blog Mela */
 * `function get_blogmela() {
    echo '<ul><li><a href="http://calamur.org/gargi/2005/
   06/18/bharateeya-blogmela-a-round-up/">Current Blog Mela</a></li>'; echo '<li
   ><a href="http://www.madhoo.com/archives/003267.php">Next Blog Mela</a></li>';
   echo '</ul>'; }
 * You can’t use the same kind of quotes inside a string which you used to open 
   the string.
 * These won’t work:
    `echo "She said "Hi there!" to me"; echo 'She said 'Hi there!'
   to me';
 * These will work:
    `echo "She saud 'Hi there!' to me"; echo 'She said "Hi there!"
   to me';
 * Note also that variable expansion _will not_ take place inside single quotes.
 * This won’t work:
    `echo 'foo = $foo';`
 * This will work:
    `echo "foo = $foo";`
 *  Thread Starter [vulturo](https://wordpress.org/support/users/vulturo/)
 * (@vulturo)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/plugin-writing-issues/#post-223568)
 * Thanks Skippy.
 * It does work. But it also appends the following warning in my admin area:
 * `Warning: Cannot modify header information - headers already sent by (output 
   started at /home/vulturo/public_html/wp-content/plugins/blogmela1.php:18) in /
   home/vulturo/public_html/wp-admin/admin.php on line 7`
 * Warning: Cannot modify header information - headers already sent by (output started
   at /home/vulturo/public_html/wp-content/plugins/blogmela1.php:18) in /home/vulturo/
   public_html/wp-admin/admin.php on line 8
 * Warning: Cannot modify header information - headers already sent by (output started
   at /home/vulturo/public_html/wp-content/plugins/blogmela1.php:18) in /home/vulturo/
   public_html/wp-admin/admin.php on line 9
 *  [jalenack](https://wordpress.org/support/users/jalenack/)
 * (@jalenack)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/plugin-writing-issues/#post-223569)
 * Do you have any space between the beginning of the document and `<?php` ? Getting
   rid of that usually gets it
 *  [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/plugin-writing-issues/#post-223595)
 * Alternatively, try this:
 * `<?php
    /* Plugin Name: Blog Mela Version: 1.0 Author: Saket Vaidya Author URI:
   http://www.vulturo.com Description: Bharateeya Blog Mela */
 * function get_blogmela() {
    ?>
 * <ul>
    <li> <a href="[http://calamur.org/gargi/2005/06/18/bharateeya-blogmela-a-round-up/">Current](http://calamur.org/gargi/2005/06/18/bharateeya-blogmela-a-round-up/">Current)
   Blog Mela</a></li> <li><a href="[http://www.madhoo.com/archives/003267.php">Next](http://www.madhoo.com/archives/003267.php">Next)
   Blog Mela</a></li> </ul>
 * <?php
    }
 * ?>

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

The topic ‘Plugin Writing Issues’ is closed to new replies.

 * 5 replies
 * 4 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [20 years, 9 months ago](https://wordpress.org/support/topic/plugin-writing-issues/#post-223595)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
