troubleshooting Question

WordPress "Hello World!" plug-in adds itself to all new pages?

Avatar of curiouswebster
curiouswebsterFlag for United States of America asked on
Web DevelopmentPHPWeb Languages and StandardsWordPressWeb Development Software
3 Comments1 Solution10 ViewsLast Modified:
I created my first PHP WordPress plugin and find that it ads itself to any new page, but I want to be able to add it when I want to.

I was not sure how much of a header, or any header, may be required by WP to be considered a plug-in.

I zipped it up, along with an empty index.html file, then zipped it into hello.zip. I added the plugin using the WP Admin panel, and found it worked.

BUT, any new page gets "Hello World!"

How do I prevent it from going into every page? And how do I place the plug-in on a page, where I would like it to appear?


 <?php
/**
 * Hello World! for WordPress
 *
 * @package   hello
 * @link      https://patriotssoar.com
 * @author    My name
 * @copyright 2021 My name
 *  *
 * Plugin Name:  hello
 * Description:  A test WordPress plugin.
 * Version:      1.0
 * Plugin URI:   https://mydomain.com
 * Author:      My name
 * Author URI:   https://mydomain.com
 * Text Domain:  hello
 * Domain Path:  /languages/
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
 */
    echo "Hello World!";
?>

Open in new window

ASKER CERTIFIED SOLUTION
David Favor
Fractional CTO
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros