WordPress.org

Ready to get started?Download WordPress

Forums

The Buffer Button Plugin (change color) (1 post)

  1. Gail
    Member
    Posted 1 year ago #

    Hi! I just installed The Buffer Button plug-in and I love just about everything about it except that the "count" bubble is green, and my blog's highlight color is orange. Specifically it is #f9ca79. When you move your cursor over the bubble it goes from one shade of green to another. Is there anyone out there who might help me to change it to two shades of orange that match my theme? It's a small thing, but it would make a big difference to me since my theme is very minimalistic. Thank you.

    http://dappledthings.me/ill-fly-away/

    Here's the index.php:

    <?php
    
    /*
    Plugin Name: The Buffer Button
    Plugin URI: http://bufferapp.com/extras/button
    Description: Add the buffer button to your blog to let people share your content on Twitter and Facebook seamlessly. They can share right away or at a better time using Buffer.
    Version: 1.0
    Author: Igloo
    Author URI: http://www.igloolab.com
    License: GPL2
    */
    
    add_filter("the_content", "the_buffer_button_the_content_filter");
    
    function the_buffer_button_the_content_filter($the_content) {
    
    	if (is_single()) {
    
    		$post = $GLOBALS["post"];
    		$the_title = $post->post_title;
    		$the_permalink = get_permalink($post->ID);
    
    		$display = get_option("the_buffer_button_display") != null ? get_option("the_buffer_button_display") : "before";
    		$style = get_option("the_buffer_button_style") != null ? get_option("the_buffer_button_style") : "vertical";
    		$twitter_username_to_mention = get_option("the_buffer_button_twitter_username_to_mention");
    
    		$the_buffer_button = sprintf(
    			"<a href=\"http://bufferapp.com/add\" class=\"buffer-add-button\" data-text=\"%s\" data-url=\"%s\" data-count=\"%s\" data-via=\"%s\">Buffer</a><script type=\"text/javascript\" src=\"http://static.bufferapp.com/js/button.js\"></script>",
    			$the_title,
    			$the_permalink,
    			$style,
    			$twitter_username_to_mention
    		);
    
    		return $display == "before" ? $the_buffer_button . $the_content : $the_content . $the_buffer_button;
    
    	}
    
    	return $the_content;
    }
    
    add_filter("admin_menu", "the_buffer_button_admin_menu_filter");
    
    function the_buffer_button_admin_menu_filter() {
    
    	add_options_page("The Buffer Button", "The Buffer Button", "manage_options", "the-buffer-button-admin", "the_buffer_button_options");
    
    }
    
    function the_buffer_button_options() {
    
    	require_once("the-buffer-button-admin.php");
    
    }
    
    ?>

    And here is the admin.php:

    `<?php

    if (isset($_POST["display"])) {
    update_option("the_buffer_button_display", $_POST["display"]);
    }

    if (isset($_POST["style"])) {
    update_option("the_buffer_button_style", $_POST["style"]);
    }

    if (isset($_POST["twitter-username-to-mention"])) {
    update_option("the_buffer_button_twitter_username_to_mention", $_POST["twitter-username-to-mention"]);
    }

    ?>

    <div class="wrap">
    <div id="icon-options-general" class="icon32"><br /></div>
    <h2>The Buffer Button Settings</h2>
    <form method="post">
    <table class="form-table">
    <tr valign="top">
    <th scope="row">
    <label for="display">Display</label>
    </th>
    <td>
    <select name="display" id="display">
    <option <?php echo (get_option("the_buffer_button_display") == "before" ? "selected=\"selected\"" : ""); ?> value="before">Before the content</option>
    <option <?php echo (get_option("the_buffer_button_display") == "after" ? "selected=\"selected\"" : ""); ?> value="after">After the content</option>
    </select>
    </td>
    </tr>
    <tr valign="top">
    <th scope="row">
    <label for="style">Style</label>
    </th>
    <td>
    <select name="style" id="style">
    <option <?php echo (get_option("the_buffer_button_style") == "vertical" ? "selected=\"selected\"" : ""); ?> value="vertical">Vertical</option>
    <option <?php echo (get_option("the_buffer_button_style") == "horizontal" ? "selected=\"selected\"" : ""); ?> value="horizontal">Horizontal</option>
    <option <?php echo (get_option("the_buffer_button_style") == "none" ? "selected=\"selected\"" : ""); ?> value="none">No count</option>
    </select>
    </td>
    </tr>
    <tr valign="top">
    <th scope="row">
    <label for="twitter-username-to-mention">Twitter username to mention</label>
    </th>
    <td>
    <input name="twitter-username-to-mention" type="text" id="twitter-username-to-mention" value="<?php echo get_option("the_buffer_button_twitter_username_to_mention"); ?>" class="regular-text" />
    <p class="description">@yourchoice</p>
    </td>
    </tr>
    </table>
    <p class="submit">
    <input type="submit" name="submit" id="submit" class="button-primary" value="Save Changes" />
    </p>
    </form>
    </div>`

Topic Closed

This topic has been closed to new replies.

About this Topic