Title: andy30z's Replies | WordPress.org

---

# andy30z

  [  ](https://wordpress.org/support/users/andy30z/)

 *   [Profile](https://wordpress.org/support/users/andy30z/)
 *   [Topics Started](https://wordpress.org/support/users/andy30z/topics/)
 *   [Replies Created](https://wordpress.org/support/users/andy30z/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/andy30z/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/andy30z/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/andy30z/engagements/)
 *   [Favorites](https://wordpress.org/support/users/andy30z/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Way to Allow User to Switch Page Colors?](https://wordpress.org/support/topic/way-to-allow-user-to-switch-page-colors/)
 *  [andy30z](https://wordpress.org/support/users/andy30z/)
 * (@andy30z)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/way-to-allow-user-to-switch-page-colors/#post-9837634)
 * You can try this it will select all elements on the page:
 *     ```
       var activated = 0;
       document.getElementById("button").addEventListener('click', function () {
       	if (activated == 0) {
       		setStyle("background-color: white; color: black !important");
       		activated = 1;
       	} else {			
       		setStyle("background-color: black; color: white !important");
       		activated = 0;
       	}
       });
   
       function setStyle(myStyle) {
       	var elements = document.getElementsByTagName("*");
       	for(var i in elements) {
       		if(elements[i].setAttribute) {
       			elements[i].setAttribute("style", myStyle);
       		}
       	}
       }
       ```
   
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Way to Allow User to Switch Page Colors?](https://wordpress.org/support/topic/way-to-allow-user-to-switch-page-colors/)
 *  [andy30z](https://wordpress.org/support/users/andy30z/)
 * (@andy30z)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/way-to-allow-user-to-switch-page-colors/#post-9837537)
 * I would suggest looking at your page using a browser developer tool. If you press
   F12 in most browsers (I prefer Chrome) and the developer tools should pop up 
   and will allow you to inspect the elements. Inspect the headlines and other elements
   that don’t have the colors you want and look at the styles and you should be 
   able to see which style is overriding your colors. Then you can adjust your styles
   so they have priority. The !important helps deal with conflicts but it doesn’t
   always work. You will have to select the headlines specifically if they aren’t
   inheriting the colors from the body.
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [How to create shortcode in class](https://wordpress.org/support/topic/how-to-create-shortcode-in-class/)
 *  [andy30z](https://wordpress.org/support/users/andy30z/)
 * (@andy30z)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/how-to-create-shortcode-in-class/#post-9835411)
 * I like to call the add_shortcode function in __construct function of the class.
 *     ```
       class PluginExample {
       	public function __construct() {		
       		add_shortcode('say-hello', array($this, 'hello'));
       	}
   
       	public function hello() {		
       		echo '<h3>Hello World!</h3>';
       	}
       }
   
       $pluginExample = new PluginExample();
       ```
   
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Way to Allow User to Switch Page Colors?](https://wordpress.org/support/topic/way-to-allow-user-to-switch-page-colors/)
 *  [andy30z](https://wordpress.org/support/users/andy30z/)
 * (@andy30z)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/way-to-allow-user-to-switch-page-colors/#post-9835389)
 * You could try this:
 *     ```
       var activated = 0;
       document.getElementById("button").addEventListener('click', function () {
       	if (activated == 0) {			
       		document.body.setAttribute("style", "background-color: white; color: black !important");
       		activated = 1;
       	} else {			
       		document.body.setAttribute("style", "background-color: black; color: white !important");
       		activated = 0;
       	}
       });
       ```
   
 * Adding the !important tag to your color attribute should override most of the
   color on the page, depending on how your theme’s style sheet is setup.
    -  This reply was modified 8 years, 4 months ago by [andy30z](https://wordpress.org/support/users/andy30z/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[All-In-One Security (AIOS) – Security and Firewall] Registration Speed](https://wordpress.org/support/topic/registration-speed/)
 *  Thread Starter [andy30z](https://wordpress.org/support/users/andy30z/)
 * (@andy30z)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/registration-speed/#post-9491419)
 * I have figured it out. It’s the sending of email that is slowing things down,
   probably due to the fact that I’m using shared hosting.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[All-In-One Security (AIOS) – Security and Firewall] Registration Speed](https://wordpress.org/support/topic/registration-speed/)
 *  Thread Starter [andy30z](https://wordpress.org/support/users/andy30z/)
 * (@andy30z)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/registration-speed/#post-9491404)
 * I do not have a cache plugin. So I’ve disabled all my plugins and it still takes
   17 seconds. I’m not sure what could be causing this. Is this normal for WordPress?
   Could it be a server configuration issue?

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