whyisjake

Jake Spurlock

May 18th, 2010
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.77 KB | None | 0 0
  1. So, this is the function that will add something to the first paragraph, I want to add everything below after the_content on posts that are part of the store.
  2.  
  3. Sample function
  4.  
  5. function add_some_stuff($content) {
  6.     $whateveryouwanttoadd = 'something here';
  7.  
  8.         $content = preg_replace('/<\/p>/', '</p><p>'. $whateveryouwanttoadd.'</p>', $content, 1);
  9.  
  10.     return $content;
  11. }
  12.  
  13. add_filter('the_content', 'add_some_stuff');
  14.  
  15. All of this is the paypal link stuff that needs to be added.
  16.  
  17. <?php $price = get_post_custom_values("thestore_price"); ?>
  18. <?php $shipping = get_post_custom_values("thestore_shipping"); ?>
  19. <?php $another = get_post_custom_values("thestore_shipping2"); ?>
  20. <?php $display = get_post_custom_values("thestore_display"); ?>
  21.  
  22. <?php if($display[0] == 'on') { ?>
  23.  
  24.         <form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="paypal">
  25.             <input type="hidden" name="cmd" value="_cart">
  26.             <input type="hidden" name="business" value="<?php echo $mama_paypal; ?>">
  27.             <input type="hidden" name="item_name" value="<?php the_title(); ?>">
  28.             <input type="hidden" name="shopping_url" value="<?php the_permalink(); ?>">
  29.             <input type="hidden" name="item_number" value="<?php the_ID(); ?>">
  30.             <input type="hidden" name="amount" value="<?php echo $price[0]; ?>">
  31.             <input type="hidden" name="currency_code" value="USD">
  32.             <input type="hidden" name="shipping" value="<?php echo $shipping[0]; ?>">
  33.             <input type="hidden" name="shipping2" value="<?php echo $another[0]; ?>">
  34.             <input type="hidden" name="handling_cart" value="<?php echo $mama_handling; ?>">
  35.             <input type="hidden" name="bn"  value="ButtonFactory.PayPal.001">
  36.             <input type="image" name="add" src="http://www.powersellersunite.com/buttonfactory/sc-but-01.gif">
  37.         </form>
  38.        
  39. <?php } ?>
Add Comment
Please, Sign In to add comment