Jump to content

Archived

This topic is now archived and is closed to further replies.

prow

Add divider shortcode

Recommended Posts

prow    0
prow

Hi there,

 

I want to add a [divider] shortcode to my website's functionality in the post loop section (in the normal WP-page design) and have tried to do the following, and it didn't work. 

 

Can you please advise how I can add this shortcode to my functionality and styling.

 

Cheers!

 

Share this post


Link to post
Share on other sites
Rob    547
Rob

Are we talking about an h-rule line?  As described in here? http://www.w3schools.com/tags/tag_hr.asp

 

Is the line that you're trying to create horizontal or vertical?


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Hi,

 

Yeah the HR tag should work just fine, but I have just created a custom shortcode and that [divider] working just fine.

 

I added the following the code to my child themes functions.php file:

add_shortcode( 'divider', 'custom_shortcode' );
 
  function custom_shortcode() {
 
    return '<div class="divider"></div>';
}

Then added the following CSS to Custom CSS:

 

.divider {
  background: #444;
  height: 1px;
  width: 90%;
}

Please search our forums, before posting!

Share this post


Link to post
Share on other sites

×