Icon on top of link instead of left/right
-
I modified your code so Top was an option. The only change was to add a condition so when Top is selected, background-position is only at top, no left or right.
I didn’t test it on several sites / themes, etc. It works perfectly on mine.
Here’s what I did:
$mtli_leftorright = ( in_array( $mtli_leftorright, array( 'left', 'right', 'top' ) ) ? $mtli_leftorright : 'left' );
echo ' .mtli_attachment { display:inline-block; height: auto; min-height:' . $mtli_height . 'px; background-attachment: scroll; background-repeat: no-repeat; padding-' . $mtli_leftorright . ': ' . ( $mtli_height * 1.2 ) . 'px !important; background-position: top ' . ($mtli_leftorright = ($mtli_leftorright = "top") ? "" : $mtli_leftorright) . '; }';
$this->alignments = array( 'left' => __( 'Left', self::$name ), 'right' => __( 'Right', self::$name ), 'top' => __( 'Top', self::$name ), );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Icon on top of link instead of left/right’ is closed to new replies.