Forum Replies Created
-
AuthorPosts
-
alex2k5Participant
OK, so I couldn't do it that way, wasn't working, but your feedback sent me on a path that did work.
Basically looking to apply lazy load tech to the images Genesis spits out. They were not being caught by BJ Lazy Load and others because they are not in the_content, which is where they search for <img code to apply lazy load specs.
What I did below is basically remove genesis_do_post_image, then re-add a modified version of it. The modified one is just the original, with the BJ Lazy Load filter applied before exporting genesis_markup. Working on my end.
Would be nice if StudioPress could make this default, easier.
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); add_action( 'genesis_entry_content', 'alex_genesis_do_post_image', 8 ); function alex_genesis_do_post_image() { if ( ! is_singular() && genesis_get_option( 'content_archive_thumbnail' ) ) { $img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'context' => 'archive', 'attr' => genesis_parse_attr( 'entry-image', array() ), ) ); $img = apply_filters( 'bj_lazy_load_html', $img ); if ( ! empty( $img ) ) { genesis_markup( array( 'open' => '<a %s>', 'close' => '</a>', 'content' => wp_make_content_images_responsive( $img ), 'context' => 'entry-image-link', ) ); } } }
alex2k5ParticipantThanks much. I will give it a shot.
alex2k5ParticipantFigured it out. Needed to alter the hook order to fire before the genesis_entry_footer_markup_close function, which is 15.
add_action( 'genesis_entry_footer', 'post_taxonomy_filter', 14);
That puts things inside the <footer></footer> block, after the default post-meta, but before </footer>.
alex2k5ParticipantLooks very good. Why did you put it in a sub domain? And what theme did you use?
Subdomain - because we were migrating from another cms which was in root, needed to be able to direct old to new. Easier this way.
Appears he built it from the Sample theme. Very nicely done.
Yes, correct. Started with sample theme, built it out from there. Once I got a hold of the themes associated with Genesis and realized most were just altered templates to include additional widget areas, I figured I could do that myself if needed. For now I've decided not to do even that, just use the pagination of default view with some tweaks to image display. That is similar to what we had before on other CMS, so it transitions well.
alex2k5ParticipantI looked at that too, completely missed the prefix line. I should be able to add it into prefix/suffix accordingly. Thanks a lot!
alex2k5ParticipantI think I actually got it, right before you posted that. I added 100 to the end of the line, I saw something mentioning ordering, didn't/don't fully quite get it yet, but figured I'd try it out, did the trick.
add_action('genesis_after_post_content','functionname',100);
Now I just need to go research why that worked, what it did fully.
I have the site blocked to all but my IP with a construction message because it's in development, but if you want to take a look, LMK your IP if you are comfortable with that. Thanks!
alex2k5ParticipantDirectly after the post-meta div. Which comes after the post_content area. When i hook it into genesis_after_post_content, I get
content
new data
post-meaI want
content
post-meta
new dataThanks.
February 1, 2013 at 1:47 pm in reply to: If statement to check if more than one image attached #17147alex2k5ParticipantI got this sorted, thanks.
alex2k5ParticipantFigured it out. The excerpt, and even that custom code you linked to, strips out shortcode before processing. In that custom code you linked to, commenting out
//$text = strip_shortcodes( $text );
Gets the desired result. I may run into issues later if I start using shortcode early on in the post content, but for now, seems to do the trick.
Thanks for the help!
February 1, 2013 at 10:35 am in reply to: If statement to check if more than one image attached #17081alex2k5ParticipantCode isn't parsing correctly, will try again.
add_action('genesis_after_post_content','gogallery', 0) ;
function gogallery() {
if (is_singular()) {
$attachments34 = get_children(
array(
'post_type' => 'attachment',
'post_parent' => $post->ID
));
if(count($attachments34) > 1) {
echo 'hello';
}
}
}
alex2k5ParticipantI did find and try that option you posted earlier, adding [B] and [URL] and variants to the ones there, but it did not work.
I will look at the options in your link now.
Thanks a lot, appreciate the quick responses.
alex2k5ParticipantAhh, so it's the plugin then. Is there a way using hooks to tell genesis or the genesis plugin to process the html using that bbcode plugin before running it's sanitizing process?
alex2k5ParticipantIn a default situation, does it strip out the text between opening and closing HTML tags as well? Or just the HTML within brackets?
For many of the blocked layouts, using the more tag won't work. They only work well when every block is roughly the same dimensions. Our text content, even with the more tag, is different per post. That's why I wanted to use the limiter. I don't prefer, but can live with HTML being stripped. However, the inner text of the HTML tags need to show up or else the teaser text is unusable.
I am in the process of migrating to WordPress from another CMS system, so I have a lot of pre-existing content not created with these features in mind. Trying to make it work within the Genesis framework as much as I can.
Thanks for the reply.
-
AuthorPosts