Skip to content

Instantly share code, notes, and snippets.

@j-mccarthy
Last active August 29, 2015 14:08
Show Gist options
  • Save j-mccarthy/14b74347220b4aa6a4a7 to your computer and use it in GitHub Desktop.
Save j-mccarthy/14b74347220b4aa6a4a7 to your computer and use it in GitHub Desktop.
<?php
/**
* Adding Html Blocks in Genesis Hooks
*
* @package Genese Gists
* @since 0.0.1
* @link
* @author John McCarthy <john@studio-momentum.co.uk>
* @copyright Copyright (c) 2014, John McCarthy
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*
*/
/**
* Genesis Gists
*/
function add_html_method_2() {
echo "<div class='gh-menu'>";
echo "<div id='gh-menu-icon-toggle' class='gh-menu-icon gh-menu-icon-toggle enhance'>";
echo "<button id='gh-svg-icons' class='gh-svg-wrapper' aria-controls='#gh-nav-list' aria-expanded='false'>";
echo "<span class='text-replace'>Menu</span>";
echo "<svg x='0px' y='0px' width='100%' viewBox='0 0 96 96' class='gh-svg gh-svg-top' enable-background='new 0 0 96 96'>";
echo "<rect width='32' height='4' x='32' y='46' class='gh-svg-rect gh-svg-rect-top'></rect></svg>";
echo "<svg x='0px' y='0px' width='100%' viewBox='0 0 96 96' class='gh-svg gh-svg-bottom' enable-background='new 0 0 96 96'>";
echo "<rect width='32' height='4' x='32' y='46' class='gh-svg-rect gh-svg-rect-bottom'></rect></svg>";
echo "</button>";
echo "</div>";
echo "</div>";
}
add_action('something', 'something', 11);
function add_html_method_3() {
$html_block = "<div class='gh-menu'>";
$html_block .= "<div id='gh-menu-icon-toggle' class='gh-menu-icon gh-menu-icon-toggle enhance'>";
$html_block .= "<button id='gh-svg-icons' class='gh-svg-wrapper' aria-controls='#gh-nav-list' aria-expanded='false'>";
$html_block .= "<span class='text-replace'>Menu</span>";
$html_block .= "<svg x='0px' y='0px' width='100%' viewBox='0 0 96 96' class='gh-svg gh-svg-top' enable-background='new 0 0 96 96'>";
$html_block .= "<rect width='32' height='4' x='32' y='46' class='gh-svg-rect gh-svg-rect-top'></rect></svg>";
$html_block .= "<svg x='0px' y='0px' width='100%' viewBox='0 0 96 96' class='gh-svg gh-svg-bottom' enable-background='new 0 0 96 96'>";
$html_block .= "<rect width='32' height='4' x='32' y='46' class='gh-svg-rect gh-svg-rect-bottom'></rect></svg>";
$html_block .= "</button>";
$html_block .= "</div>";
$html_block .= "</div>";
echo $html_block;
}
add_action('something', 'something', 11);
function add_html_method_4() {
$html_block = ' <div class="gh-menu">
<div id="gh-menu-icon-toggle" class="gh-menu-icon gh-menu-icon-toggle enhance">
<button id="gh-svg-icons" class="gh-svg-wrapper" aria-controls="#gh-nav-list" aria-expanded="false">
<span class="text-replace">Menu</span>
<svg x="0px" y="0px" width="100%" viewBox="0 0 96 96" class="gh-svg gh-svg-top" enable-background="new 0 0 96 96">
<rect width="32" height="4" x="32" y="46" class="gh-svg-rect gh-svg-rect-top"></rect></svg>
<svg x="0px" y="0px" width="100%" viewBox="0 0 96 96" class="gh-svg gh-svg-bottom" enable-background="new 0 0 96 96">
<rect width="32" height="4" x="32" y="46" class="gh-svg-rect gh-svg-rect-bottom"></rect>
</svg>
</button>
</div>
</div>';
echo $html_block;
}
add_action('something', 'something', 11);
function add_html_method_5() { ?>
<div class="gh-menu">
<div id="gh-menu-icon-toggle" class="gh-menu-icon gh-menu-icon-toggle enhance">
<button id="gh-svg-icons" class="gh-svg-wrapper" aria-controls="#gh-nav-list" aria-expanded="false">
<span class="text-replace">Menu</span>
<svg x="0px" y="0px" width="100%" viewBox="0 0 96 96" class="gh-svg gh-svg-top" enable-background="new 0 0 96 96">
<rect width="32" height="4" x="32" y="46" class="gh-svg-rect gh-svg-rect-top"></rect></svg>
<svg x="0px" y="0px" width="100%" viewBox="0 0 96 96" class="gh-svg gh-svg-bottom" enable-background="new 0 0 96 96">
<rect width="32" height="4" x="32" y="46" class="gh-svg-rect gh-svg-rect-bottom"></rect>
</svg>
</button>
</div>
</div>
<?php }
add_action('something', 'something', 11);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment