Community Forums › Forums › Archived Forums › General Discussion › Modify Featured Image Permalink within Archive Loop
Tagged: featured image, genesis_get_image
- This topic has 17 replies, 2 voices, and was last updated 6 years, 7 months ago by Brad Dalton.
-
AuthorPosts
-
August 7, 2017 at 8:40 pm #210101signatureddMember
https://gist.github.com/jillmaturino/8a5240785bb77988d3c654696fc1189b
This is example of code that I used to modify the permalink in the title on archive page. I need to also modify the permalink that is on the featured images as well. How can I do this?
August 8, 2017 at 6:36 am #210111Brad DaltonParticipantA easy way to do this without using a filter is to use a custom archive page template which removes the default featured image and adds back a custom version which includes a custom field for the image URL or a link hardcoded in the snippet.
August 8, 2017 at 7:41 am #210116Brad DaltonParticipantAugust 8, 2017 at 12:56 pm #210129signatureddMemberOk, yes, I am using a custom archive page template, but I don't know how to remove the default featured image and replace it with a new one. Is there an example that I could see?
August 8, 2017 at 1:07 pm #210130Brad DaltonParticipantAugust 8, 2017 at 2:41 pm #210138signatureddMemberI don't believe my theme is HTML5. I can't get either the remove_action or add_action below to work. Are there different hooks for non HTML5?
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
add_action( 'genesis_before_entry', 'featured_image_no_https', 12 );August 8, 2017 at 2:48 pm #210139Brad DaltonParticipantAugust 8, 2017 at 4:54 pm #210141signatureddMemberhttp://www.cdcgamingreports.com/gaming-tv/
Would love to upgrade at some point. Site is quite involved. Need to research more on it.
August 8, 2017 at 5:01 pm #210143Brad DaltonParticipantAugust 8, 2017 at 6:07 pm #210144signatureddMemberI see there is code here to convert to HTML5. I am assuming it is not going to be as easy as pasting one line of code into functions.php. I assume things will break. What am I looking at in terms of backwards compatibility?
August 8, 2017 at 6:23 pm #210146Brad DaltonParticipantI would test this first on a test site.
You can convert to HTML 5 using this tool however i suggest a new HTML 5 theme is better.
You could start with the Sample theme which is the free default theme for Genesis
August 8, 2017 at 7:35 pm #210149signatureddMemberIsn't there any way to address the changes I originally requested without going through this yet?
I would like to convert to HTML5, but this is a major task on a very custom theme. We can't just easily switch to a new theme. This is going to take some time and I need to fix the issue related above immediately.
August 9, 2017 at 4:26 am #210156Brad DaltonParticipantTo convert to HTML 5 takes 2 minutes :
1. Add the line of PHP to your child themes functions file.
2. Copy & paste all the CSS from your style.css file into the converter and click convert. Then you can paste it back into your style sheet.
Personally, i don't have any code for XHTML themes.
August 9, 2017 at 9:39 am #210192signatureddMemberOk, I will give it a whirl tonight. Converting the CSS seemed easy, if the tool worked properly. What about hooks that I might have to change? I assume a few were not compatible when moving over. Are there a list of old XHTML hooks that need to be changed?
August 9, 2017 at 12:27 pm #210202Brad DaltonParticipantAugust 9, 2017 at 1:52 pm #210207signatureddMemberThank you. Just so I can be sure I am doing this right. I just change genesis_post_title to genesis_entry_header ?
// Add offsite icon to newsroom title links
add_action('genesis_post_title','offsite_icon');
function offsite_icon() {
stuff here;
}August 9, 2017 at 10:01 pm #210213signatureddMemberI have upgraded to HTML5. Thank you. Went fairly smooth. I have addressed the original issue with the code here. It works great, but I would like to move the image to the left of the title. Normally, we can do that with this:
// Move post title to the right of the image
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
add_action( 'genesis_entry_header', 'genesis_do_post_image', 5 );What is my best way to make this happen now?
August 10, 2017 at 11:02 am #210240Brad DaltonParticipantPlease start a new thread for a new question and mark this one as resolved. Thanks.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.