Sponsor Flipwall Shortcode
Modify the Size of the Shape in Plugin (4 posts)

  1. davejampole
    Posted 4 years ago #

    I've just downloaded and activated the plugin and it works just like it is supposed to. I did a little 'tweeking' of the .css file to change the size of the flip square, size of the font in the title and position of the title within the square.

    I have a question on a feature I would like to have. I have found some potential sponsors whose logos are rectangular rather than square and they don't resize worth a darn ex: arklatexmoaa.org - then bottom of first page.

    How difficult would it be to create a shape with user controlled size (rectangle) that could be placed next to a square or a second rectangle, both within the same [flipwallgroup][/flipwallgroup]?

    Thanks for your plugin.

    Dave Jampole


  2. Baden
    Posted 4 years ago #


    We came up with a hack by changing the following lines of abt-sponsor-flipwall.php:

    1. find the shortcode_tile function around line 81 and add width and height attributes to the shortcode_atts array:

    ,'image' => false
    ,'width' => null
    ,'height' => null

    2. after if($content == null){ $content = $text; } add the following:

    $style = "";
    if($width != null || $height != null ){
    	$style = "style='";
    	if($width != null){
    		$style .= "width: ".$width."px;";
    	if($height != null){
    		$style .= " height: ".$height."px;";
    	$style .= "'";

    3. finally add the style override to the Click to flip div like so:
    <div title="Click to flip" class="flipwall-tile<?php if($class != null){ echo ' ', esc_attr($class); } ?>" id="<?php echo esc_attr($id); ?>" <?php echo $style; ?>>

    Or, the version we hacked, you can download it from the Plugin Oven at: http://plugins.twinpictures.de/wp-content/uploads/2012/03/sponsor-flipwall-shortcode-1.2.2.zip

    Hopefully they will include this in the next release!

  3. zaus
    Plugin Author

    Posted 4 years ago #

    Sounds like a reasonable request, I'll try to bake it in.

    However, couldn't you just use the existing attributes "id" or "class" to update the styles? Like, for a specific tile you use:
    [flipwall id="tile-barksdale" ...]
    or for generic rectangles:
    [flipwall class="tile-rect" ....]

    Then in your own stylesheet (no need to modify plugin's):

    #tile-barksdale { width:X; height:Y }
    div.flipwall-tile.tile-rect { width:240px; }

    If you really just hate the provided stylesheet, you can switch it out entirely with your own using the hook explained in FAQ >> Can I change the defaults? -- in YOURFN you override the stylesheet index like:

    function my_custom_flipwall_settings($settings){
       $settings['stylesheet'] = get_stylesheet_directory_uri() . '/css/myflipwall.css';
       return $settings;
    add_filter('abtSponsorFlipwall_localize', 'my_custom_flipwall_settings');
  4. davejampole
    Posted 4 years ago #


    I'm sure there are more than one way to skin this cat, but the technique Baden came up works 100% for me.

    Just from a personal perspective, I find it easier to add the height and width values in the [flipwall][/flipwall] code. Doing it this way keeps me out of the .php, .js and .ccs files. Less chance of me screwing something up.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Sponsor Flipwall Shortcode
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic