• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to show a double dash —

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › General Genesis Framework Discussions › How to show a double dash —

This topic is: not resolved
  • This topic has 3 replies, 2 voices, and was last updated 4 years, 8 months ago by AnitaC.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • May 21, 2021 at 12:44 pm #504073
    rogerp
    Participant

    I have a lot of code that I need to show on my blog

    This -- in wordpress is being translated into this -

    I have read many posts and already added this to functions.php

    remove_filter( 'the_title', 'wptexturize' );
    remove_filter( 'the_content', 'wptexturize' );
    remove_filter( 'the_excerpt', 'wptexturize' );

    I also commented out these lines in wp-includes/formatting.php

    //$dynamic[‘/—/’] = $em_dash;
    //$dynamic[ ‘/(?<=^|’ . $spaces . ‘)–(?=$|’ . $spaces . ‘)/’ ] = $em_dash;
    //$dynamic[‘/(?<!xn)–/’] = $en_dash;
    //$dynamic[ ‘/(?<=^|’ . $spaces . ‘)-(?=$|’ . $spaces . ‘)/’ ] = $en_dash;

    I am putting the code within SyntaxHighlighter, but it looks like wordpress is turning the double dash into a single dash

    How do I stop it doing this!


    Roger
    https://www.rogerperkin.co.uk/
    Check out my Network Automation Training – Training the Network Engineers of the Future

    https://www.rogerperkin.co.uk/network-automation/pyats/pyats-genie-tutorial/
    May 24, 2021 at 3:13 pm #504096
    AnitaC
    Keymaster

    I think you need to add this to your functions.php to remove that.

    add_filter('run_wptexturize', '__return_false');
    

    See this document and this one.


    Need help with customization or troubleshooting? Reach out to me.

    May 25, 2021 at 8:42 am #504118
    rogerp
    Participant

    Thanks for your reply, but that did not fix my issue

    functions.php

    /* Remove Double Dash

    add_filter( 'run_wptexturize', '__return_false' );

    */


    Roger
    https://www.rogerperkin.co.uk/
    Check out my Network Automation Training – Training the Network Engineers of the Future

    May 25, 2021 at 9:35 am #504119
    AnitaC
    Keymaster

    Hi @rogerp since that's something related to WordPress itself and not your theme, you may want to post this question on the WordPress forums - https://wordpress.org/support/forum/miscellaneous/. Someone there may be able to answer that.


    Need help with customization or troubleshooting? Reach out to me.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble