• Hey guys, so I made a template for my page.php which I would like to use in my gallery, instead of the built in functions.
    I guess that i need to make a copy of my something-that-has-to-do-with-gallery.php using FTP, but I can’t seem to find the specific .php file 🙁 HELP

Viewing 1 replies (of 1 total)
  • assuming you are referring to the build-in [gallery] shortcode, to edit the default code, you can remove the shortcode and add your own shortcode instead;

    for instance, in functions.php of your theme:

    remove_shortcode('gallery','gallery_shortcode');
    add_shortcode('gallery','custom_gallery_shortcode');
    
    function custom_gallery_shortcode( $attr ) {
    //your gallery code//
    }

    do not edit WordPress core files; just for reference, the native gallery shortcode is in /wp-includes/media.php from line 659

Viewing 1 replies (of 1 total)

The topic ‘Changing gallery to template’ is closed to new replies.