Community Forums › Forums › Archived Forums › Design Tips and Tricks › modifying the HTML source of loops
Tagged: loops
- This topic has 7 replies, 3 voices, and was last updated 11 years, 1 month ago by jdingman.
-
AuthorPosts
-
February 19, 2013 at 12:48 pm #21393jdingmanMember
So when viewing the archives of a tag, it has the normal title, content, image, etc.
How can I customize the source of that output?
My goal is what I want to add special code around the links that the title is using and add other code around the loop.
Would I need to use a completely customized loop to do it? If so, how would I view what the current loop is producing so I can copy it and customize it?
Thank you
Blogging at jonathan.vc
February 19, 2013 at 1:47 pm #21415Christopher HarrisMemberYou can hook into elements in the loop. See the hook reference section 'loop action hooks': http://my.studiopress.com/docs/hook-reference/
Also, this visual hook guide is handy: http://genesistutorials.com/visual-hook-guide/
WordPress Consultant and Genesis Developer http://wpattendant.com
February 19, 2013 at 2:39 pm #21444jdingmanMemberHi Christopher,
I tried looking at genesis_post_title as a hook, but in my testing I wasn't able to modify the HTML.
Do you have any examples I could see?
Blogging at jonathan.vc
February 20, 2013 at 7:11 am #21625Christopher HarrisMemberI do not have any code examples at the moment, but check out Bill Erickson's code snippets for Genesis. He has many helpful bits... http://www.billerickson.net/code/
WordPress Consultant and Genesis Developer http://wpattendant.com
February 24, 2013 at 9:19 pm #22634wpsmithMemberHello Jonathan,
The question is quite vague as to your needs. However, this should help you get you on your way:
February 25, 2013 at 3:26 pm #22761jdingmanMemberThanks Travis, that should definitely help.
I'll play around with it and see what I can do.
Question actually, is there a place I can view all the options to modify the $title and those variables? I'm not sure what I have available to modify.
Blogging at jonathan.vc
February 25, 2013 at 8:16 pm #22820jdingmanMemberI'm a little confused about this as well,
function wps_tag_post_title_text( $title ) {
// do something
return $title;
}How do I modify what the actual HTML for the top HTML is of a title?
I'm trying to implement Schema.org data into my page, that's what I'm trying to modify the HTML for.
Blogging at jonathan.vc
February 25, 2013 at 8:19 pm #22821jdingmanMemberFor example, if I have this HTML:
<div class="post-3984 person type-person status-publish hentry entry">
<h2 class="entry-title"><a href="http://v3./person/brian-gardner/" title="Brian Gardner" rel="bookmark">Brian Gardner</a></h2>
<div class="entry-content">
<div class="post-info"><span class="date published time" title="2013-01-17T00:11:50+00:00">January 17, 2013</span> By <span class="author vcard"><span class="fn"><a href="http://v3./author/jonathan/" class="fn n" title="Jonathan Dingman" rel="author">Jonathan Dingman</a></span></span> <span class="post-comments"><a href="http://v3./person/brian-gardner/#comments">20 Comments</a></span> <a class="post-edit-link" href="http://v3./wp-admin/post.php?post=3984&action=edit" title="Edit Person">(Edit)</a></div><p>My name is Brian Gardner and I created this site. Call it a playground, of sorts, for my mind to unravel itself into paragraph form. I love to write. In fact, I’ve always loved to write. When I was younger, it was an exit strategy — a way to let go of reality and enter a world that meant peace.</p>
</div><!-- end .entry-content -->
I want to edit almost every tag so I can manually add stuff, like itemscope and itemprop all the along the way.
Blogging at jonathan.vc
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.