Answers.Body: <p>CiviCRM only picks out a discrete list of shortcode parameters: <a href="https://github.com/civicrm/civicrm-wordpress/blob/8aa70bce802bd163984986a701b22f89841bfc74/includes/civicrm.shortcodes.php#L562" rel="nofollow">see the code here</a>.  Adding an additional shortcode parameter will not make CiviCRM recognize it and add it to the rewritten request.</p>
  
  <p>Unfortunately, without rewriting CiviCRM's WordPress integration, you won't be able to get this to work via shortcode.  You'll have to use the big long URL instead.  If you're trying to generate a friendly URL, you might have to <a href="http://www.hongkiat.com/blog/wordpress-url-rewrite/" rel="nofollow">manually set a rewrite</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-09T17:35:49.777Z
Answers.Text: Looking at the code, it doesn't look like CiviCRM has any hooks to accept custom parameters for extensions either. I'll have to dig a little deeper into how it parses the URL.
Answers.UserDisplayName: Paul Dufresne
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-09T17:14:24.387Z
Answers.LastActivityDate: 2016-05-09T17:14:24.387Z
Answers.UserDisplayName: Andie Hunt
Body: <p>It took me a while, but I figured out how to get CiviDiscount to work when providing the link directly to the contribution page, however I'm trying to use a shortcode to embed the CiviCRM contribution page into a WordPress page.</p>
  
  <p>The generated shortcode looks like this:</p>
  
  <pre><code>[civicrm component="contribution" id="2" mode="live" hijack="0"]
  </code></pre>
  
  <p>I modified it to look like this:</p>
  
  <pre><code>[civicrm component="contribution" id="2" mode="live" discount="pkpwpabs7" hijack="0"]
  </code></pre>
  
  <p>I took a guess, but my guess was wrong. Is there a way to do this?</p>
  
Tags: <wordpress><civicontribute><cividiscount>
Title: Can I apply a CiviDscount discount when embedding a contribution page in a WordPress page?
ThreadText: # Can I apply a CiviDscount discount when embedding a contribution page in a WordPress page?
  
  (Asked by: username_0 on 2016-05-09)
  
  It took me a while, but I figured out how to get CiviDiscount to work when providing the link directly to the contribution page, however I'm trying to use a shortcode to embed the CiviCRM contribution page into a WordPress page.
  The generated shortcode looks like this:
  [civicrm component="contribution" id="2" mode="live" hijack="0"]
  
  I modified it to look like this:
  [civicrm component="contribution" id="2" mode="live" discount="pkpwpabs7" hijack="0"]
  
  I took a guess, but my guess was wrong. Is there a way to do this?
  
  **Tags:** wordpress, civicontribute, cividiscount
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-05-09. Score: 2 | Accepted answer
  
  CiviCRM only picks out a discrete list of shortcode parameters: [see the code here](https://github.com/civicrm/civicrm-wordpress/blob/8aa70bce802bd163984986a701b22f89841bfc74/includes/civicrm.shortcodes.php#L562). Adding an additional shortcode parameter will not make CiviCRM recognize it and add it to the rewritten request.
  
  Unfortunately, without rewriting CiviCRM's WordPress integration, you won't be able to get this to work via shortcode. You'll have to use the big long URL instead. If you're trying to generate a friendly URL, you might have to [manually set a rewrite](http://www.hongkiat.com/blog/wordpress-url-rewrite/).
  
  > **Comments:**
  > **username_0**: Looking at the code, it doesn't look like CiviCRM has any hooks to accept custom parameters for extensions either. I'll have to dig a little deeper into how it parses the URL.  
  
  ---
  
  