Hi @jedanbaja
This option is currently not available. However, there are two options you can use to add a gallery title as a workaround. The first is to easily implement this with whatever page builder you are using. Simply add a text block/widget on top of the gallery and add a descriptive text to the text block/widget.
The second option uses some custom code. Follow these steps to get this working with some custom code:
- Make sure the FooGallery album extension is enabled
- Goto Settings -> Albums and enable “Enable Gallery Descriptions” and save
- Add this custom code to your functions.php file or a code snippets plugin such as the WPCode plugin:
add_action( 'foogallery_loaded_template_before', 'foogallery_render_gallery_description' );
function foogallery_render_gallery_description( $foogallery ) {
if ( isset( $foogallery->_post ) && !empty( $foogallery->_post->post_content ) ) {
$content = apply_filters( 'the_content', $foogallery->_post->post_content );
echo $content;
}
}
You should then see a content editor when editing a gallery, and the code above will add that content above the gallery. You can choose to customize how it is output and wrap it in a div or paragraph etc.
Thanks
Kind regards,
Elvis
Hi,
second option with code is working, but problem if want to edit this page in elementor, its always stuck. If i disable this code in code snippet where i added, editor work normal, so its something with this code problem for editing page where are galleries inserted using elementor page builder.
Hi,
found solution that is better than you proposed.
Dont need to enable “Albums” extensions and no need to enter description for each gallery, just enter Gallery title and code will pull it into page where is gallery inserted:
add_action( 'foogallery_loaded_template_before', 'foogallery_render_gallery_description' );
function foogallery_render_gallery_description( $foogallery ) {
if ( isset( $foogallery->_post ) && !empty( $foogallery->_post->post_content ) ) {
$content = apply_filters( 'the_content', $foogallery->_post->post_content );
echo '<div class="foogallery-overlay-title">' . $content . '</div>';
}
}