Wordpress: Adding media, custom alignment styles?

Discussion in 'PHP' started by Josh-H, Aug 31, 2013.

  1. #1
    Hi guys,

    I've been searching everywhere for a way to do this, but nobody seems to know how, so I thought I'd ask here!

    Basically, when you add a new image to an article in Wordpress, you can choose from 3 alignment options: left, right and center.

    I want to be able to add 2 new extra styles, with their own css classes associated. I can't just repurpose the css for the current selectors, as I want these in addition.

    Does anyone know a good or even hacky way to do this? Thanks!

    [​IMG]
     
    Josh-H, Aug 31, 2013 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,897
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #2
    I'd ask over at the wordpress support forums.

    If you don't get an answer then it might be a case of going through the source code to find where the list is built and adding a hook - then find where it's actioned and add a hook. Now write a plugin that uses those hooks and submit the hooks to the WordPress folk as a suggestion.

    I did exactly this (different context) and tried to follow their naming conventions. In the very next version of WordPress the hook was added - same name - and my plugin worked! Nothing extra for me to do, I was very happy :) You might feel that your requirement is unusual but I'm sure there are others who want it but have just never made a noise. Ask, you might just get it!
     
    sarahk, Aug 31, 2013 IP
  3. viral133

    viral133 Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #3
    Hi
    When select media file and insert insert post than in wordpress editor there is two button at top
    1) visual
    2) Text

    select second text
    now you see the anchor(<a>) and img tags of your media
    you can write your custom css in it


    Thanks
    Viral
     
    viral133, Aug 31, 2013 IP