WordPress.org

Ready to get started?Download WordPress

Forums

Attachments
not want to show images in loop (6 posts)

  1. dados
    Member
    Posted 1 year ago #

    Hi,

    I use your great plugin but this time I need to customize it... So I go to your tutorial...
    https://github.com/jchristopher/attachments/blob/master/docs/usage.md

    First I disable disable the default instance in wp-config.php...
    And Add in function.php code from "Create Custom Instances" because I need only title.. and I use code "Pulling Attachments to your Theme" in the loop ... but I did not get anything??? the loop is empty.. In admin when I want to edit posts there is show 'My Attachments' .. and I upload image and save.. everything cool but from some reason not want to show it in loop..

    Just for info.. plugin works with default options.. I install plugin.. Upload image and use code in loop and its work.. but with this tutorial its not work.. I am not sure why??

    Thanks

    http://wordpress.org/extend/plugins/attachments/

  2. dados
    Member
    Posted 1 year ago #

    okay.. I found why is this happen.. can you please change your tutorial.. I think you have error there .. and maybe will good to change it because it can be a little confused :)

    Link to tutorial

    When you create "Create Custom Instances" you will write function

    function my_attachments( $attachments )

    and then in loop you will have this

    <?php $attachments = new Attachments( 'attachments' ); /* pass the instance name */ ?>

    but this is not good you need to change to this

    <?php $attachments = new Attachments( 'my_attachments' ); /* pass the instance name */ ?>

  3. Jonathan Christopher
    Member
    Plugin Author

    Posted 1 year ago #

    The documentation is specifically designed to outline the fact that your instance name needs to be passed, not copied and pasted from the docs. Many people get caught up just where you did but it's a result of copying and pasting the sample code instead of reading the instructions on how to write your own. Very glad you were able to take a second spin through the docs and get it figured out, I hope you enjoy the plugin!

  4. dados
    Member
    Posted 1 year ago #

    okay.. yes I enjoy it.. thank you for this great plugin... only one idea.. what you think, to write in tutorial, that coder must change this part of code, to replace it with own name of function.. :)

    and one more question .. can this slider be responsive? if yes.. than you have best slider plugin on planet :)

  5. Jonathan Christopher
    Member
    Plugin Author

    Posted 1 year ago #

    The documentation does state that you need to pass in your own instance name, and the comment on the line you pasted reiterates that:

    /* pass the instance name */

    Attachments doesn't do anything but interact with the admin and store the data, the idea being you can directly integrate with your favorite responsive slider very easily.

  6. dados
    Member
    Posted 1 year ago #

    great. .thank you very much for support

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.