Increase font size WP

Sander k

New member
Is there a plugin for WordPress (widget) that my visitors could use to make the font size bigger?
As my newest website (under construction) also gets loads of half blind people on it.

I have tried lots of plugins from WordPress.org allready they they don't work at all!
 

ogah

New member
i make this plugins for you

PHP:
<?php

/*
Plugin Name: Zoom Font
Description: Zoom in or zoom out text size
Version: 1.0
Author: Ogah
Author URI: http://www.ddlgen.net/
*/

########### ZOOM WIDGET ###########
class Zoom extends WP_Widget {
	function __construct() {
		$widget_ops = array('classname' => 'widget_zoom', 'description' => __( "Zoom in or zoom out font size of wordpress") );
		parent::__construct('zoom', __('Zoom Font'), $widget_ops);
	}

	function widget( $args, $instance ) {
		extract($args);
		$title = apply_filters('widget_title', empty($instance['title']) ? __('Zoom Font') : $instance['title'], $instance, $this->id_base);

		echo $before_widget;
		if ( $title )
			echo $before_title . $title . $after_title;

	?>
		<form method='get' action=''><input type='number' name='zoom' size='4' value=''/> % <input type='submit' value='Zoom'/></form>
	<?php

		echo $after_widget;
	}

	function update( $new_instance, $old_instance ) {
		$instance = $old_instance;
		$instance['title'] = strip_tags($new_instance['title']);

		return $instance;
	}

	function form( $instance ) {
		$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
		$title = strip_tags($instance['title']);
?>
			<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
<?php
	}
}

function zoomfont() {
	register_widget('Zoom');
}

add_action('widgets_init', 'zoomfont');
########## END ZOOM WIDGET ##########

if(isset($_GET['zoom'])) {
	if(is_numeric($_GET['zoom'])) {
		setcookie('zoom', $_GET['zoom']);
	}
	echo "<meta http-equiv='refresh' content='0; url=".$_SERVER['HTTP_REFERER']."'>\r\n";
}

function zoomtext() {
	$zoom = $_COOKIE['zoom'];
	echo '<style type="text/css">'."\r\nbody {\r\n\tfont-size: ".$zoom."%;\r\n}\r\n</style>\r\n";
}
if(isset($_COOKIE['zoom'])) {
	add_filter('wp_head', 'zoomtext');
}
save this script to your plugins folder, activate from wp admin and drag the Zoom Font widget to your sidebar.
you can zoom in or zoom out font size of your wordpress by %.

sorry if my plugins not work, i am newbie in PHP and new in wordpress :)
 

ogah

New member
that plugin will adding this css in your wp header, if cookies zoom set
Code:
<style type="text/css">
body {
font-size: *%;
}
</style>
with * is value from cookies zoom.

which url Sander?
maybe redirected by ads from dirty advertiser
 

ogah

New member
do you mean my ddlgen.net?
i use cpmfun and clicksor ads, both ads not have option for disable dirty advertiser :(
i guess it come from clicksor ads
 

ogah

New member
thanks for your notification. i will inspect my website. what your country IP that redirected to that url?

btw, have you try my plugins? work or not?