Jump to content


New Members
  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Cp1

  • Rank
  1. Ok, I've been having a hard time writing a plugin and getting it to work. I've posted here and have gotten some very good advice. Every time I try to implement it it doesn't work. I think I may have found the problem, or at least have a clue. It may be how I installed it on my localhost. I decided to dedicate most of the day to get something going on the site. I finally opened open the web console in Firefox after noticing one of the plugins installed on the live site wasn't working. What I noticed is when the live site loads it loads a bunch of content from the wp-content folder and the wp-includes folder. My local site loads only basic files. Both have the same plugins installed, with the settings the same. This explains why none of my plugin javascript, or anything for that matter was showing up. Now, what am I doing wrong. I compressed the files using the tar command on my terminal. I used scp to transfer it to my computer. I tar to uncompress the file. I then set the "document root" setting on my MAMP server to the folder containing these files. I re-did these steps and got the same result. I did notice the live site is www.sitename.com. My localhost is localhost/folder/Welcome.html. I reviewed the settings on my localhost and they seem to be the same as the live site. Any suggestions. Is my document root wrong? I think once I get this figured out I'll be set.
  2. My code is on my home computer so I don't have access to it until tonight. It does have the PHP tags and a simple header. I've had this problem for about a week or so. I had to not work on it for a few days because it is so frustrating. I have tried watching several tutorials and have deleted and reinstalled everything being careful at every step. I have stepped back and created a few simple plugins going step by step with the tutorials that I am watching. Everything seems fine. I activate the plugin like normal, and then nothing changes on the frontend, only admin. I've ruled out browser cache, php cache, server cache. I have disabled all other plugins just in case they might be doing something. Is there some simple setting or something I'm missing? The code I use seems to work for everyone else. The site I am working on is a live site. I copied the code and database to my local machine. In wp-config.php I have updated the database information and set the MAMP path the the folder containing the code. I had to update the following below to stop the admin from redirecting to the live site: define('WP_HOME', ""); define('WP_SITEURL',""); I'm all out of ideas. I will post my code for the simple plugin printing the version. I have not done much else because I cannot get past this problems. Any guesses or suggestions would be appreciated.
  3. global $wp_version; die($wp_version); I've watched a couple tutorials and followed step by step. I'm trying to add some javascript to the page. I need it on the frontend. I only see it in admin. I've watched another tutorial and try to step it back from what I was doing. Above is what I've done. I decided to see if any code will work just in case the hooks I was using were wrong. It shows the version in the admin. It seems no matter what I do, I could drop a bomb on the site. Nothing, that I have done affects the frontend, but shows up in admin.
  4. I'm new to Wordpress and am working on creating a couple plugins in my spare time. I've started some work but only see my plugins working in the admin. No matter what I do the frontend of my website is not affected. Caching is disabled on my browser on the MAMP server, I am working locally. I also know it isn't a cache issue because my changes show up immediately in the admin. Any ideas or suggestions?
  5. Great, thanks for the help! I had to adjust some settings. Thanks for the advice about the wp_print_scripts and the get_footer and get_header. When my plugin didn't work I started throwing everything at the problem just to get my message to show up.
  6. Hmmm, interesting. I will check on that. I will check the name. I will also check the cache settings on my MAMP server. I cleared my browser cache. Did the message show up on the header and footer? I appreciate the response!
  7. I am trying to write my first plugin. So I read some tutorials and figured I'd start with a simple plugin to make sure I understood everything I read. I just wanted to echo "Hello World" on the screen. Simple. I created the plugin and saw it in my admin. I activated it. So far, so good. Then... nothing happens. My code is extremely simple. I'm sure someone will look at it and see the problem. I did some more research online and I tried to echo the message several ways: <?php /* Plugin Name: Hello */ function hello_world() { echo "Hello!"; print("Hello World"); } add_action('wp_print_scripts', 'hello_world'); add_action('get_header', 'hello_world'); add_action('get_footer', 'hello_world'); add_action('wp_header', 'hello_world'); add_action('wp_footer', 'hello_world'); ?>
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.