• Resolved steevithak

    (@steevithak)


    I’m trying to grok the SLB theming tutorial but it leaves out a lot of necessary info. Can anyone answer a couple of newbie questions:

    1. I’ve downloaded the sample custom SLB theme files from the git repo but it’s unclear where I’m expected to put them. The logical place would be a subdirectory of my wordpress theme but the instructions are mute on this topic. I see references in the code to the base plugins directory, so that’s another possibility though less intuitive. Where should the files actually go?

    2. In order to make WordPress and the SLB plugin recognize the new theme, it seems like I would need to add some code into the functions.php file but there is no mention of editing this file in the custom theme tutorial. All it talks about it making edits to the main.php file that’s part of the sample theme. Do I need to install any code into functions.php and if so, what?

    If anyone knows of a simple step-by-step tutorial to creating an SLB theme, that would be awesome too. The official one is more like a collection of random descriptions of data structures and variables but there’s no “how to actually make it work” instructions.

    https://wordpress.org/plugins/simple-lightbox/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter steevithak

    (@steevithak)

    I’ve made some progress on this. I finally noticed a comment in one of the PHP files that suggested an SLB theme is not a theme in the WordPress sense but a WordPress Plugin. So the first step in their tutorial should probably be something like “Download the example theme and place the files in the directory wp-content/plugins/slb-theme-example-master – once this is done, wordpress sees the “theme” as a new plugin which can be activated in the plugins admin page.

    This got me part way there. The theme is recognized by SLB and can be selected in the lightbox setup but there is still lots of missing info in the tutorial on how to use it. Apparently, for example, if you want to control the CSS, you have copy a CSS files from one of the built-in SLB themes and then uncomment some stuff in the example theme’s main.php file. Doing this got me to the point where I can restyle the divs that make up the lightbox and replace the loading image.

    However, I still haven’t figured out how to replace the nav button graphics. Even with the custom theme in place, for example, lightbox still grabs the close nav button images from simple-lightbox/themes/default/images/ui_close.png

    I’ve tried putting replacement images in the custom theme images directory but they’re not picked up. I’ve uncommented all the files mentioned in main.php and copied their contents from one of the built-in themes but still no-go.

    Anyone know how to override the nav button graphics?

    Plugin Author Archetyped

    (@archetyped)

    Hi, apologies for the delayed response, I’ve been on the road for the past couple weeks.

    Indeed, the current tutorial is primarily aimed at developers, though I am hoping to do a simplified tutorial in the future.

    However, the tutorial does note: “This tutorial covers adding a custom theme as a WordPress plugin, but it could also be done as part of a theme with a few simple modifications.”

    This is also reflected in the readme file included with the downloadable sample theme: “Use this plugin as the starting point for your own custom themes.”

    Using a plugin allows you to add and share standalone SLB themes, but a lightbox theme can also be easily registered within a WordPress theme thanks to WP’s flexible hook system.

    You can add the same functions and use the same hooks from the tutorial in a theme’s functions.php file to register a theme, though some modifications may be required (such as loading CSS files).

    As noted in the tutorial, you can use any existing theme as the “parent” of your own custom theme. From there, you would include your own custom HTML & CSS files containing your customizations. For example, customizing the images used in the lightbox would require a custom stylesheet to point to your own graphics.

    If possible, please post a link to a page with your custom theme activated and what you are having trouble with and I would be glad to help you get your theme working as desired.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Where does custom SLB theme go?’ is closed to new replies.