WordPress.org

Support

Support » Plugins and Hacks » Attachments » Include Attachements Plugin in Theme

Include Attachements Plugin in Theme

  • I am working on trying to include the attachements plugin as part of a theme package.

    1. I have added the whole “attachements” folder to my theme folder
    2. I’ve added the following to my theme functions file.


    //Include Attachements Plugin http://wordpress.org/extend/plugins/attachments/
    require_once dirname(__FILE__) . '/attachments/index.php';

    This shows up the attachements fine in the pages/posts at the bottom, but when I go to add a new attachement it pulls up the screen, I am able to select the image and the modal window closes but no attachment is shown on the page like it does when the plugin is just activated.

    I am wondering if it might have something to do with permissions as well. I am running this on a multisite setup where I have to set up permissions manually. Are there any special permissions that I need to think about? Thanks so much for your help or thoughts.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Ah, I did a bit more testing and found this javascript error.


    Uncaught ReferenceError: attachments_uniqid is not defined post.php:1228
    (anonymous function) post.php:1228
    T.each.T.forEach load-scripts.php:433
    r.(anonymous function) load-scripts.php:459
    (anonymous function) post.php:1225
    g.Events.trigger load-scripts.php:443
    f.extend._onModelEvent load-scripts.php:458
    g.Events.trigger load-scripts.php:443
    f.view.Toolbar.Select.f.view.Toolbar.extend.clickSelect load-scripts.php:476
    f.view.Button.f.View.extend.click load-scripts.php:476
    v.event.dispatch load-scripts.php:2
    o.handle.u

    I’m looking into this more… if anyone has any thoughts I’d love to hear them.

    Plugin Author Jonathan Christopher

    @jchristopher

    I would recommend not adding it as part of your theme and distributing it that way and instead instruct users to download and install Attachments as a plugin.

    🙁 This theme is being added to a multisite network. I can’t add the plugin to the network… is there no way to make this work as part of a theme. 🙁

    Plugin Author Jonathan Christopher

    @jchristopher

    It’s just bad practice to pull a plugin from it’s natural place and include it in a theme, sorry. You’ll need to manually update every time the plugin is updated and that’s just the tip of the iceberg. While technically yes it’s possible, it’s not something I’ll be able to sponsor by outlining in detail here. I’m sorry to hear that some sort of red tape is preventing you from using Attachments, but it sounds like it’s not the right solution for your project at this time. Have a good day.

    Okay. Thanks Jonathan. I appreciate your feedback.

    Plugin Author Jonathan Christopher

    @jchristopher

    No problem, sorry to hear that you’re in the situation you are, I’m not sure how to best suggest handling your want to include something like Attachments when you’re not able to utilize a new plugin. If anything comes to mind I’ll follow up on this thread.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Include Attachements Plugin in Theme’ is closed to new replies.
Skip to toolbar