• Resolved DownunderDabbler

    (@downunderdabbler)


    Interesting- wordpress 3.8.4 isn’t on the dropdown list of versions to choose from …

    I am adding some images and pdf files to someone else’s pages (at their request) and I am wanting to centre a few pdf files separated by paragraphs of text. I am using [dg category=”category_name”] which works well for placing the pdf thumbnails but it ignores tinymce’s centre command when the page is previewed or live; it sits in the middle nicely in the editor, but that’s all.

    The page in question is here with the pdf off to the left while the rest of the page is centred. Centred text is not my choice, just what’s there.

    Many thanks for a great plugin which is sooo useful. This page is an example of why I love this plugin. I am off to rate now ??

    Hakim

    https://www.ads-software.com/plugins/document-gallery/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Dan Rossiter

    (@danrossiter)

    Hey Hakim,

    You’ll want to include this in your Custom CSS (bottom of Dashboard->Settings->Document Gallery):
    .document-icon-wrapper { text-align: center !important }

    If you don’t want the same effect on all of the galleries on the site, you could also wrap the ones that you do want centered in a div (eg: <div class="center">[dg category="category_name"]</div>) and then use the following in the custom CSS to have them all center while leaving the rest alone:
    .center .document-icon-wrapper { text-align: center !important }

    Please let me know if that doesn’t do it for you or you have any further questions! ??

    -Dan

    PS: If you’ve found this plugin useful, please take a moment to rate it. Thanks! ??

    Thread Starter DownunderDabbler

    (@downunderdabbler)

    Thanks Dan, the one-liner does it for this task and I will play around with the individual wrappers later today.

    Thank you very much. You have 5 stars from me ??

    Hakim

    Thread Starter DownunderDabbler

    (@downunderdabbler)

    This works: .document-icon-wrapper { text-align: center !important }

    but the following in dg css settings doesn’t, all gallery icons being left aligned. Have I missed something?

    <div class=”center”>[dg category=”Colour Walk”]</div>)
    .center .document-icon-wrapper { text-align: center !important }

    Thanks Dan

    Plugin Author Dan Rossiter

    (@danrossiter)

    Hmm… To be honest, I didn’t test that second option before posting, but just tested now and it is working for me.

    One thing that could be happening… When you’re editing the post, make sure you’re in “Text” rather than “Visual” mode. Visual mode sanitizes angle brackets to “<” and “>”. Does that help at all?

    -Dan

    Thread Starter DownunderDabbler

    (@downunderdabbler)

    He smiles to himself as he realises the second lot of code with the div belongs in the post, not in the css section of the plugin.

    I know it’s a very slow way of learning WordPress and css but … I have to start somewhere.

    Thank you very much Dan. All is working for me now and this little question has opened new doors for me.

    All the best,

    Hakim

    Plugin Author Dan Rossiter

    (@danrossiter)

    So glad that everything worked out, Hakim!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to centre dg images on page?’ is closed to new replies.