About this topic

  • Posted by zac 1 year ago. There are 4 posts. The latest reply is from byron.
  • This topic is resolved
  1. Hi, I am hoping to work this into the template I am building but as far as I can tell you can only call a gallery using the shortcode in the html editor. The way my template is, it is all broken up with a bunch of custom fields (actually "magic" fields) displaying different bits in their own little frame. To work with this layout I would need to keep Photosmash separate from the main post content. Is there a way to call the gallery id in another way than the shortcode in the main HTML editor?

    Thanks for all of your work on this Byron. It is really one of the best plugins out there :)

  2. Thanks, Zac! I appreciate the comment!

    If by "magic" fields you mean you can feed it some PHP and it will execute, then you're in business. I have no experience with magic fields, and very little with custom fields.

    The PHP you'd need would looks something like:

    <?php echo do_shortcode("[photosmash]"); ?>

    That will display the gallery that is linked to the current post in the Loop.

    If you know the Gallery ID (say you had a variable like $customfield['gallery_id'] ), then you could:

    <?php echo do_shortcode("[photosmash id=" . $customfield['gallery_id'] . "]"); ?>

    I don't know what variable you would have for the custom field. But that's the basic format for displaying the gallery.

    Hopefully that gets you started. Let me know if you've got other questions on it.

    BB

  3. Fantastic! That is just what I needed. I did not know about do_shortcode .. that is very handy! "magic fields" is actually the name of a plugin, they are similar to custom fields but I guess not necessary if I do it like this. Thanks!

  4. Welcome!
    BB

RSS feed for this topic