WordPress Tutorial Videos by WP101®

Learn WordPress with tutorial videos for beginners.

  • Buy All-Access Pass
  • About WP101®
    • Products We ❤️
    • Testimonials
  • WordPress Tutorials
    • Intro to WordPress
    • WordPress 101
    • Become a Better Blogger
    • WPForms 101
    • WooCommerce 101
    • Beaver Builder 101
    • Ninja Forms 101
    • WP Rocket 101
    • Jetpack 101
    • Yoast SEO 101
  • Help Forum
    • Hire a WordPress Expert
    • Contact Us
  • Blog
  • Log In

How to create hanging indents in WordPress?

Astra Promo
WordPress Q&A Forum › How to create hanging indents in WordPress?
0
Vote Up
Vote Down
C

Cary Northwest

asked 2 years ago

I need to do hanging indents for a reference page done in APA style. How do I do this? I am using the Pure & Simple theme.

1 Answers
0
Vote Up
Vote Down
Shawn Hesketh answered 2 years ago

Hi Cary,

As you’ve no doubt discovered by now, there is no method in WordPress for creating hanging indents. To add hanging indents, you’ll need to edit the underlying CSS (Cascading Style Sheet) that determines the look and layout of objects on your site.

The CSS will be something like this, though you can adjust the values to your needs:

style="margin-left:.5in; text-indent:-.5in"

But, the tricky bit is where to apply that CSS. This varies, depending on the theme you’re using.

You said you’re using the Pure & Simple theme. In that theme (and many others), the paragraphs on both pages and posts are wrapped in a section with the class of: .entry-content

So, you could go to: Appearance > Customize > Additional CSS and add the following:

.entry-content p { margin-left:.5in; text-indent:-.5in }

When you save your changes, that would apply a hanging indent to every single paragraph on every page or post on your site. That’s not what you want. You probably want to only apply the hanging indent to certain paragraphs, or only on that one page.

To apply the CSS to only that one page, open the page in your browser and right-click, then select “Inspect Element” (or whatever your browser calls this function). That will open the underlying source code for the page.

Near the top, just underneath the <head></head> section, look for the <body class="page-id-1234">, where “1234” represents the unique page ID for that particular page.

With that variable, we can return to: Appearance > Customize > Additional CSS and add something like the following:

.page-id-1234 .entry-content p { margin-left:.5in; text-indent:-.5in }

That code will only affect paragraphs within the .entry-content section, and only on the page with the ID of: 1234

But what if you only want to apply the hanging indent to individual paragraphs?

In that case, instead of the CSS above, you can create a new, custom class like the following:

.hanging-indent { margin-left:.5in; text-indent:-.5in }

Be sure to save your changes.

Then, when you’re creating a page or post, you can apply that special class to just the paragraph(s) you choose. In the Block Editor (Gutenberg), you’ll first type your paragraph content. Then, in the Tools on the right-hand side, under the “Advanced” section, you’ll find a field in which you can enter “Additional CSS class(es)”.

In that field, enter: hanging-indent (Or whatever name you chose for your custom class.)

Then, your custom CSS styling will be applied to that paragraph. Repeat this process for any additional paragraphs to which you wish to apply your custom, hanging-indent style.

Whew. That’s a lot to take in.

I hope this helps!

Please login or register to join the conversation.

Ask a Question

Share this with someone?

FacebookTweetLinkedIn

Most Recent Questions

  • How do I migrate a Local site to a new host other than Flywheel? asked by etometich, 2 weeks ago
  • The My Cart page is not in my pages (not in trash or draft either). What do I do? asked by Paige, 1 month ago
  • Which option changes the background color of the payment box on the checkout page? asked by Paige, 2 months ago
  • WordPress 6.0 asked by Philip Gledhill, 2 months ago
  • How do I create a shopping cart page? asked by Paige, 2 months ago
  • Question about Genesis Pro subscription key? asked by HollyM, 2 months ago
  • How do you set up a photo gallery page? asked by quiltsunfolded, 2 months ago

Need a WordPress Expert?

Need a quick fix or minor tweak to your WordPress theme? Or a custom feature for your site? Chat with a WordPress expert!

Chat Now

Site Links

  • About Us
  • Your Account
  • Products We ❤️
  • Affiliates
  • Testimonials
  • Blog
  • Contact Us

Courses

  • FREE Intro to WordPress
  • WordPress 101
  • WooCommerce
  • WPForms
  • Jetpack
  • Yoast SEO
  • View All Courses…

Products

  • WP101.com
  • WP101 Plugin
  • Embed our videos on your site!

Connect with Us

  • Email
  • Facebook
  • Twitter

WordPress Tutorials by WP101© 2008-2022 WP101® LLC, Houston, TX. All rights reserved.
WP101® is a registered trademark with the U.S. Patent and Trademark Office.
WP101® is hosted by Cloudways.
Privacy Policy | Terms of Use | Disclosure | WP101 Coupon