Forums

Help for simple shortcode coding (2 posts)

  1. kkanedaa
    Member
    Posted 6 months ago #

    Hey everyone,

    I am one step away from finishing my WordPress powered website. But there is one small thing remaining to make it look as I wish.

    What I am looking for is to write a shortcode that outputs a simple dotted divider. The shortcode should look something like this [dotted_divider]. The divider should have a 5px top and bottom margin so when using this divider, there will automatically be a nice white space between texts.

    Can anyone help me out?

    Thanks

  2. Josh
    Member
    Posted 6 months ago #

    Why don't you just set up a css class for the <hr> tag?

    Like this in your CSS:

    hr.ruler {
      border: 1px dotted #ff0000;
      border-style: none none dotted;
      width: 100%;
      color: #f00;
      background-color: #f00;
      height: 2px;
    }

    Then you can simply call it at anytime by writing <hr class="ruler" /> in your posts/pages.

Reply

You must log in to post.

About this Topic