Title: Add quotes using shortcode
Last modified: August 20, 2016

---

# Add quotes using shortcode

 *  Resolved [cableghost](https://wordpress.org/support/users/cableghost/)
 * (@cableghost)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/)
 * I would like the ability to add opening and ending quotes ‘<q></q>’ using a shortcode.
 * I know shortcodes cannot add curling q’s to quoted text, but all I want this 
   shortcode to do is to wrap selected text in <q> brackets.
 * So, in a View Page Source DOM, text would look like…
 * <p><q>this would be the quoted text</q></p>
 * Reasons why…browsers today auto-add the curly q’s upon seeing <q>, and search
   engines recognize them as specific quoted text, giving them more weight than 
   just using a class to create the affect.
 * As far as why creating a shortcode…I can had one simple button to TinyMCE, then
   I can highlight the text and click the respective button to add the <q> brackets.

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/add-quotes-using-shortcode/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/add-quotes-using-shortcode/page/2/?output_format=md)

 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/#post-2368569)
 * Why not use `<blockquote></blockquote>` instead?
 *  Thread Starter [cableghost](https://wordpress.org/support/users/cableghost/)
 * (@cableghost)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/#post-2368576)
 * Well, blockquote is much different than <q> quotes, in terms of appearance, how
   search engines view it, and it is ‘block’, not inline.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/#post-2368578)
 * > browsers today auto-add the curly q’s upon seeing <q>, and search engines recognize
   > them as specific quoted text, giving them more weight than just using a class
   > to create the affect.
 * They also recognise the `blockquote` tag which, given your example above, would
   be the semantically correct markup.
 *  Thread Starter [cableghost](https://wordpress.org/support/users/cableghost/)
 * (@cableghost)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/#post-2368589)
 * Okay, say for a moment I go with blockquote, however, I want to use it inline;
   could someone provide me the css to allow blockquote to be inline and if possible,
   auto-add the curly q’s around the text?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/#post-2368593)
 * Inline? But it’s inside a block level element (`<p></p>`). Why not use `<blockquote
   <p>this would be the quoted text</p></blockquote>` which would be the correct
   markup?
 *  Thread Starter [cableghost](https://wordpress.org/support/users/cableghost/)
 * (@cableghost)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/#post-2368595)
 * For example, see the below. If I use a fair amount of quoting, the layout really
   looks garbled in blockquoting style, so I wish to elect using it inline.
 * HP Looks Panicky as It Dumps Valuable Mobile, Consumer Product … eweek.com: In
   August 2011, HP announced they were going to drop their consumer-based products,
   and focus on enterprise client market. Something to think about for future budgets._“
   Aug 20, 2011 … News Analysis: The first question that comes to mind as HP abruptly
   changes direction is what were they thinking? The second question has…”_
 * Is there a way to use blockquotes inline??
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/#post-2368597)
 * Which part are you referencing? The whole quote? Or just the italics?
 *  Thread Starter [cableghost](https://wordpress.org/support/users/cableghost/)
 * (@cableghost)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/#post-2368618)
 * Just the italics
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/#post-2368620)
 * OK – so in that context `<q?</q>` would be correct. But why use a shortcode when
   that would involve more typing than the correct HTML tags?
 *  Thread Starter [cableghost](https://wordpress.org/support/users/cableghost/)
 * (@cableghost)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/#post-2368631)
 * As initially mentioned…
 * As far as why creating a shortcode…I can had one simple button to TinyMCE, then
   I can highlight the text and click the respective button to add the <q> brackets.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/#post-2368635)
 * It should be relatively easy to do using add_shortcode:
 *     ```
       function quote_func($content) {
            return '<q>' . $content . '</q>;
       }
       add_shortcode('quote', 'quote_func');
       ```
   
 * [http://codex.wordpress.org/Function_Reference/add_shortcode](http://codex.wordpress.org/Function_Reference/add_shortcode)
 *  Thread Starter [cableghost](https://wordpress.org/support/users/cableghost/)
 * (@cableghost)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/#post-2368664)
 * Thank you…couple things.
 * There was a ‘ missing in your code…corrected code below.
 *     ```
       function quote_func($content) {
            return '<q>' . $content . '</q>';
       }
       add_shortcode('quote', 'quote_func');
       ```
   
 * The function creates the shortcode, but when executed, it doesn’t wrap the text,
   it creates another empty segment, as such…
 * `<p><q></p></p>`
 * I’ve tried to figure it out within the link you provided, but I can’t. Any ideas?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/#post-2368665)
 * You need to use `[quote]blah...blah[/quote]`.
 *  Thread Starter [cableghost](https://wordpress.org/support/users/cableghost/)
 * (@cableghost)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/#post-2368678)
 * That’s how I use it, but it acts like there’s no content, like so…
 * [inline-quotes]Content here.[/inline-quotes]
 * The result…
 * “”
    Content here.
 * PS. I changed ‘quotes’ to ‘inline-quotes’
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/#post-2368685)
 * Try:
 *     ```
       function quote_func($atts, $content = null) {
            return '<q>' . $content . '</q>';
       }
       add_shortcode('inline-quotes', 'quote_func');
       ```
   

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/add-quotes-using-shortcode/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/add-quotes-using-shortcode/page/2/?output_format=md)

The topic ‘Add quotes using shortcode’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 21 replies
 * 3 participants
 * Last reply from: [cableghost](https://wordpress.org/support/users/cableghost/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/add-quotes-using-shortcode/page/2/#post-2368940)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
