Community Forums › Forums › Archived Forums › Design Tips and Tricks › >>PLEASE!: Genesis 2 New Hooks – How to Use?!
Tagged: genesis 2 new hooks
- This topic has 4 replies, 2 voices, and was last updated 11 years, 7 months ago by Alessandra.
-
AuthorPosts
-
May 30, 2013 at 12:53 pm #43253AlessandraMember
Hey, Guys!
I need some help here. I was using the simple hooks plugin with the previous version of the framework, but now i upgraded to the beta version to get that html5 support and already changed my theme to be compatible.
The thing is that the simple hooks plugin does not work anymore since the hook names are changed. And i had some stuff hooked on my theme using that plugin.
Would someone give me some clue on how to hook those things through my functions.php using the new hooks?
The hooks and the content are these:
- genesis_before_post_content Hook
> --->Content inside this hook is:
<?php
if(is_page()) { ?>
<div class="post-info author vcard">Por: <a href="http://denrrou.com.br/author/denrrou/" class="fn n" title="denrrou" rel="author">denrrou</a> Última Atualização em:
<?php // if the post has been modified, display the modified date
$published = get_the_date( 'F j, Y' );
$modified = the_modified_date( 'F j, Y', '', '', FALSE );
$published_compare = get_the_date( 'Y-m-d' );
$modified_compare = the_modified_date( 'Y-m-d', '', '', FALSE );
if ( $published_compare < $modified_compare ) {
echo '<span class="updated"> ' . $modified . '</span>';
} ?>
</div>
<?php }
?>
> And...- genesis_after_post_content Hook
> -->Hook content:
<?php if (is_single()) { ?>
<div class="prev_next">
<div class="nav_left">
<span class="prev">Post Anterior:</span> <?php previous_post_link('%link', '%title'); ?>
</div class="nav_right">
<div>
<span class="next">Próximo Post:</span> <?php next_post_link('%link', '%title'); ?>
</div>
</div><div class="share-and-subscribe">
<div class="left">
<h4 id="compartilhe">Compartilhe!</h4>
<p><iframe src="//www.facebook.com/plugins/like.php?href=<?php the_permalink(); ?>&send=false&layout=button_count&width=100&show_faces=false&action=like&colorscheme=light&font&height=21&appId=122606047898277" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe></p>
<p><a href="https://twitter.com/share" class="twitter-share-button" data-url="<?php the_permalink(); ?>" data-text="<?php the_title(); ?>" data-via="denrrou">Tweet</a></p>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<p>
<div class="g-plusone" data-size="medium"></div>
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</p>
<p><script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share" data-url="<?php the_permalink(); ?>" data-counter="right"></script></p>
</div>
<div class="right">
<h4 id="newsletter">Subscreva e Nunca Perca um Post!</h4>
<p>Subscreva gratuitamente a nossa Newsletter para dicas e atualizações!</p>
<form method="post" action="http://newsletter.denrrou.com/form.php?form=1" id="frmSS1" onsubmit="return CheckForm1(this);">
<p><label for="newsletter-name">Nome:</label> <input type="text" class="newsletter subscriber name" name="CustomFields[2]" id="CustomFields_2_1" value=""></p>
<p><label for="newsletter-email">Email:</label> <input type="text" class="newsletter subscriber email" name="email" value="" /></p>
<input type="hidden" name="format" value="h" />
<p class="subscribe-button"><button type="submit" class="subscribe">Subscrever Agora!</button></p>
</form>
<script type="text/javascript">
// <![CDATA[function CheckMultiple1(frm, name) {
for (var i=0; i < frm.length; i++)
{
fldObj = frm.elements[i];
fldId = fldObj.id;
if (fldId) {
var fieldnamecheck=fldObj.id.indexOf(name);
if (fieldnamecheck != -1) {
if (fldObj.checked) {
return true;
}
}
}
}
return false;
}
function CheckForm1(f) {
var email_re = /[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i;
if (!email_re.test(f.email.value)) {
alert("• Mas... Primeiro me deixe saber o seu email! Insira-o no campo abaixo e eu funcionarei! ☺");
f.email.focus();
return false;
}return true;
}// ]]>
</script></div>
</div>
<?php } elseif ( is_page() ) { ?>
<div class="share-and-subscribe">
<div class="left">
<h4 id="compartilhe">Compartilhe!</h4>
<p><iframe src="//www.facebook.com/plugins/like.php?href=<?php the_permalink(); ?>&send=false&layout=button_count&width=100&show_faces=false&action=like&colorscheme=light&font&height=21&appId=122606047898277" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe></p>
<p><a href="https://twitter.com/share" class="twitter-share-button" data-url="<?php the_permalink(); ?>" data-text="<?php the_title(); ?>" data-via="denrrou">Tweet</a></p>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<p>
<div class="g-plusone" data-size="medium"></div>
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</p>
<p><script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share" data-url="<?php the_permalink(); ?>" data-counter="right"></script></p>
</div>
<div class="right">
<h4 id="Newsletter">Subscreva e Nunca Perca um Post!</h4>
<p>Subscreva gratuitamente a nossa Newsletter para dicas e atualizações!</p>
<form method="post" action="http://newsletter.denrrou.com/form.php?form=1" id="frmSS1" onsubmit="return CheckForm1(this);">
<p><label for="newsletter-name">Nome:</label> <input type="text" class="newsletter subscriber name" name="CustomFields[2]" id="CustomFields_2_1" value=""></p>
<p><label for="newsletter-email">Email:</label> <input type="text" class="newsletter subscriber email" name="email" value="" /></p>
<input type="hidden" name="format" value="h" />
<p class="subscribe-button"><button type="submit" class="subscribe">Subscrever Agora!</button></p>
</form>
<script type="text/javascript">
// <![CDATA[function CheckMultiple1(frm, name) {
for (var i=0; i < frm.length; i++)
{
fldObj = frm.elements[i];
fldId = fldObj.id;
if (fldId) {
var fieldnamecheck=fldObj.id.indexOf(name);
if (fieldnamecheck != -1) {
if (fldObj.checked) {
return true;
}
}
}
}
return false;
}
function CheckForm1(f) {
var email_re = /[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i;
if (!email_re.test(f.email.value)) {
alert("• Ué... Você está se parecendo comigo! Não esqueça de inserir primeiro o seu email! ☺");
f.email.focus();
return false;
}return true;
}// ]]>
</script></div>
</div>
<?php } ?>Will be very grateful if you can help me out on this.
Best regards.
http://denrrou.com.brMay 30, 2013 at 6:39 pm #43279Brad DaltonParticipantI don't think the Genesis Simple Hooks plugin uses the new hooks just yet.
You may need to use the code in custom functions using the new hooks in your child themes functions.php file.
May 30, 2013 at 6:53 pm #43281AlessandraMemberHello, Brad!
I know that. The plugin should be updated only after the final release of the Framework.
Do you know how i can implement that through the new hooks based on the information i gave on my initial question?
=/
Thanks!
May 30, 2013 at 6:58 pm #43282Brad DaltonParticipantYou would need to use the new hooks in custom functions with your existing code rather than use Simple Hooks.
Once you've added HTML 5 support to your child theme, some of the old hooks won't work as they have been renamed.
Try this http://www.nathanrice.net/blog/genesis-loop-hooks/
I'd guess that SP will release a table comparison of the new and old hooks shortly.
Try these:
genesis_before_post_content = genesis_before_entry_content genesis_after_post_content = genesis_after_entry_content
June 2, 2013 at 12:27 pm #43638AlessandraMembercould not get great results with those.... =/
i miss that plugin so much... sniff... sniff
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.