Split Content and Gallery

Open to anybody who can simplify this but here’s what I came up with that worked for me. First thing’s first – get the gallery, using get_post_gallery(), as soon as the loop starts: <?php if( have_posts() ) : ?> <?php while( have_posts() ) : the_post(); $gallery = get_post_gallery(); $content = strip_shortcode_gallery( get_the_content() ); ?> <div … Read more

Output all images from gallery inside a slider

Ok, so, I found this function, but it wasn’t in the codex. It came from Pippin’s Plugins, just to clarify for any future readers. It appears this function was used as a filter added onto the content, and will only run when filtering existing content, because it’s retrieving & replacing the galleries placed inside the … Read more

How to create sidebar from “scratch”?

Technically “off topic” here as your actual question is open-ended and there is lots of room for opinion. https://wordpress.stackexchange.com/help/dont-ask Sidebars and widgets are a perfect way to organize these elements. Keep in mind these are simply tools to organize blocks for repeated use in various locations. So, officially, my answers to your two questions are: … Read more

Extract Gallery picture info from empty gallery shortcode

I don’t like how WordPress processes the gallery shortcode. This is some slightly modified code I had that I’ve used to get the images in a gallery. In this example, the attachments (and thus their IDs) would only be available after the gallery shortcode has been processed. If you’re looking to display different HTML than … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)