Where to edit styles for media - gallery in wordpress?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • druid66
    Confirmed User
    • Feb 2006
    • 994

    #1

    Where to edit styles for media - gallery in wordpress?

    hey guys,
    i was wonder..
    what if i want to add my own style to photos inside wordpress posts?
    no problem when i'm using standard html line:

    <a href="image url"><img src"thumb url"></a>

    with my style it will look like this:

    <a href="image url" class="my style"><img src"thumb url"></a>

    but what if all my posts are media - gallery like here:

    [gallery link="file" ids="2269,2268,2267,2266,2265,2264,2263,2262"]

    where can i add my styles there?
    Pure Japan japanese babes blog
  • myleene
    Confirmed User
    • Oct 2013
    • 906

    #2
    In the gallery plugin where it renders the images or in its css depending on what you want to do and which gallery you are using.

    Comment

    • druid66
      Confirmed User
      • Feb 2006
      • 994

      #3
      using standard one gallery which is built in wordpress.
      do you know exactly where can i edit it?
      if it would be plugin for gallery that i'm using i would normally go to plugins/edit but it's not so that's why i'm looking my way into it.
      Pure Japan japanese babes blog

      Comment

      • myleene
        Confirmed User
        • Oct 2013
        • 906

        #4
        Oh. I though you were using a WordPress gallery plugin like NextGen Gallery or Photo Gallery.

        You'll need to do something like this then:
        zurb foundation - Change Wordpress default gallery output - Stack Overflow

        And you should do it in a child theme.

        Comment

        • druid66
          Confirmed User
          • Feb 2006
          • 994

          #5
          appears i'm to dumb to do this using code they are tweaking on the site you linked to.
          so to add style - simple style to standard wordpress gallery i need to do this in functions.php in child theme of my WP?
          can you show me a bit how to do this in functions and not to fuck it up?

          not like i won't try myself but you can speed up if you know where to exactly i should paste my damn class="mystyle" (that's example ofc).

          and thanks for trying help, appreciate.
          Pure Japan japanese babes blog

          Comment

          • SlickTz
            Registered User
            • May 2015
            • 10

            #6
            Use a Child Theme

            Originally posted by druid66
            appears i'm to dumb to do this using code they are tweaking on the site you linked to.
            so to add style - simple style to standard wordpress gallery i need to do this in functions.php in child theme of my WP?
            can you show me a bit how to do this in functions and not to fuck it up?

            not like i won't try myself but you can speed up if you know where to exactly i should paste my damn class="mystyle" (that's example ofc).

            and thanks for trying help, appreciate.
            You should probably set up a child theme. I use the WP plugin: One-click Child Theme

            On the style sheet for your child theme, place your CSS code. Hope this helps.

            Comment

            • myleene
              Confirmed User
              • Oct 2013
              • 906

              #7
              Originally posted by druid66
              appears i'm to dumb to do this using code they are tweaking on the site you linked to.
              so to add style - simple style to standard wordpress gallery i need to do this in functions.php in child theme of my WP?
              can you show me a bit how to do this in functions and not to fuck it up?

              not like i won't try myself but you can speed up if you know where to exactly i should paste my damn class="mystyle" (that's example ofc).

              and thanks for trying help, appreciate.
              It's advanced WordPress, it requires more than 5-10 minutes to achieve and it requires good understanding of your setup. I wouldn't try it directly on a live blog as it could break it.

              Read this: https://codex.wordpress.org/Child_Themes

              I could do it for you if you wish or tell you how it can be achieved based on your setup. Contact me.

              Comment

              • druid66
                Confirmed User
                • Feb 2006
                • 994

                #8
                Originally posted by SlickTz
                You should probably set up a child theme. I use the WP plugin: One-click Child Theme

                On the style sheet for your child theme, place your CSS code. Hope this helps.
                i know i can setup my own theme, but i'm tweaking already good theme now i want photos to be displayed in the way i want it.

                Myleene: pm sent, thanks.
                Pure Japan japanese babes blog

                Comment

                • kristin
                  GOO!
                  • Sep 2002
                  • 9768

                  #9
                  Originally posted by SlickTz
                  You should probably set up a child theme. I use the WP plugin: One-click Child Theme

                  On the style sheet for your child theme, place your CSS code. Hope this helps.
                  Thanks for that plugin.

                  I have two clients whose templates didn't have a child theme and I need to create it to do updates. Thanks!
                  Vacares rules.

                  "Usually only fat guys have the kind of knowledge and ability that Kristin has."

                  Comment

                  • druid66
                    Confirmed User
                    • Feb 2006
                    • 994

                    #10
                    fucking done it, google is the king ;)
                    thanks for all the helps guys, if anyone wanna know how to add style to href tag inside gallery, pm me.
                    Pure Japan japanese babes blog

                    Comment

                    • zerovic
                      Confirmed User
                      • Apr 2010
                      • 1114

                      #11
                      i know you already solved it, but every wordpress gallery starts with an ID with a class 'gallery'. You can simply override the default styles by adding a new style to your css file

                      .gallery a { } or gallery img { }

                      I do that and it does the job really good ;)

                      Hope it helps ;)
                      z
                      php, html, jquery, javascript, wordpress - contact me at contact at zerovic.com

                      Comment

                      • druid66
                        Confirmed User
                        • Feb 2006
                        • 994

                        #12
                        thanks for the tip.
                        this code added to functions.php solved my problem:

                        function my_get_attachment_link($html) { $postid = get_the_ID(); $html = str_replace('<a', '<a class="mystyle"', $html); return $html; } add_filter('wp_get_attachment_link', 'my_get_attachment_link', 10, 1);
                        Pure Japan japanese babes blog

                        Comment

                        • Babaganoosh
                          ♥♥♥ Likes Hugs ♥♥♥
                          • Nov 2001
                          • 15841

                          #13
                          I hope you did that in a child theme or all of your changes go poof on an update.
                          I like pie.

                          Comment

                          • druid66
                            Confirmed User
                            • Feb 2006
                            • 994

                            #14
                            ofc
                            Pure Japan japanese babes blog

                            Comment

                            Working...