In Genesis Facebook group a user asked:
Trying to modify archive & front-page loops to get a link around a few divs.
I tried to open the linktag with
but every time I try to add genesis specific "do_actions" later in the loop, the <a> tag gets closed right afterwards. So what would be the right way to get that done?
Trying to hyperlink all the children of
.entry elements on content archives in Genesis to the entry's permalink is like a disaster waiting to happen (ok, that was dramatic.. site is not going to crash, but the output will be broken on the frontend) unless we ensure that there are no anchor elements anywhere inside.
In this tutorial, we shall
- rewrite `genesis_do_post_image()` so that the featured image is not hyperlinked
- create a template part called `content-archive.php` in which we
- remove all actions hooked to `genesis_entry_footer`
- open HTML for entry link
- display unlinked featured image
- remove the featured image (linked)
- remove entry titles' links
- customize post info to display post date and unlinked post author
- close HTML for entry link
- load the template part in `home.php` and `archive.php`
to get the following sample HTML output for each
.entry on content archives in Genesis:
While the tutorial has been written for Genesis Sample, it should work with a few adjustments in any Genesis theme
Add the following in child theme's functions.php:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.