Posts Tagged ‘WPAds’

Post Snippets: Must Have WordPress Plugin for Inserting Shortcodes

Make Your Own WordPress Shortcodes

For years I had been using a plugin called WPAds for inserting all kinds of HTML and Javascript code like affiliate banner ads and Adsense into my posts on the HTML tab editor.  But with some recent WordPress update, switching back to the Visual tab would strip them out.  So fricking annoying.  Also, it started escaping double quotes with a backslash when adding or updating the ad units and that broke them.   (There’s a fix on that page.)  It was also a pain in the butt that every time I wanted to use an ad, I had to go to WPAds control panel and copy the code to paste it into my post.  So today I had enough and looked for a plugin allowing me to create my own shortcodes.  I found one.

Post Snippets
by author Johan Steen, a CG Artist

Post Snippet Plugin - Button to insert shortcodes into a WordPress post or page.Switching between Visual/HTML editor tabs will not erase what was inserted.  That’s so sweet.  The code is inserted into your post via a button on the editor toolbar.  In the interface, the code snippets are represented by tabs.  Just click on the tab you want to use.  If you set up variables, fields will appear on the screen for you to enter the values.  Ideally, the screen should be more compact by using a drop-down list instead of tabs, but hey, it inserts the shortcodes.  On a high level, here’s how it works.

Post Snippet control panel

  • Post Snippet displayTitle:  Give your snippet a title.  I found out you can’t use spaces.
  • Variables:  If your code has replaceable variables, enter a comma separated list.  If not, leave it blank.  Reference the variables in your code with {curly braces}.  You can even use it for inserting adhoc text.
  • Snippet Type:  Select the type of snippet you want to create, a shortcode or a quicktag.  A shortcode will create a shortcode.  Doh!  A quicktag will actually insert the raw HTML code snippet into your post, but it does it hella stealth.  The banner or whatever will appear on the Visual editor, but if you switch to the HTML tab, wa-la! there’s the code.  Cool.   These are check boxes, but they’re not working right for me.  I used to be a programmer, so I know the difference between check boxes and radio buttons.  They’re acting like radio buttons.  If you check nothing, it defaults to quicktag.  If you check either shortcode only or quicktag only, the appropriate one will be used.  However, if you check both, I would assume that you would be able to select which option to use when inserting the code, but no choice is given.  It’s defaulting to quicktag.  FYI:  Ideally, use shortcodes because if you make changes to the code, it will change all occurrences globally throughout your blog.  Not so if you insert the raw code using quicktags.
  • Snippet:  The actual raw code you want to have executed.
  • Description:  Your own little note, only seen on the admin page.

Download it from WordPress.org:  http://wordpress.org/extend/plugins/post-snippets/
Author’s website with documentation:  http://wpstorm.net/wordpress-plugins/post-snippets/

After reading the comments on the author’s site, I can see this is a work in progress and he’s improving on it over time. For now, it’s doing what I need it to do and that’s all that counts.  Thanks, Johan.  This is a sweet plugin.

Share

How to Work With Ads in WordPress

If you display the same banner ads or PPC ads over and over in your posts or pages, there’s no need to copy and paste the code each time.  There’s a slick free ad manager plug-in that can do multiple things.

  • Rotate ads within the same space by creating zones.
  • Create individual ads to use when and where ever you like.
  • Use a PHP code snippet to modify your theme, or…
  • Use a tag to insert into your posts/pages only as needed.

Plugin(s) You’ll Need: 

  1. WPAds
  2. Advanced Text (optional, for display ads in sidebars)

Once installed, you can configure it in Settings > WPAds.

Description:  A brief description of what the ad is.

HTML Code:  Paste your HTML code in here.

Zones:  The name of a zone (area) on your blog.  When multiple ads are assigned to the same zone, they will rotate according to the next three settings.   You can configure an add to run in multiple zones by separating zone names with a comma.

Active:  Checkbox toggle to activate/deactivate the display of a particular ad.

Weight:  How often an ad should display in relationship to the other ads in the same zone.  1 is the default.  The higher the number, the more it displays.

Max Views:  Set the maximum number of impressions an ad should display.  Once the number has been reached, it stops displaying even when the Active checkbox is checked.

When you click the Save button, the code you’ll need to insert will display in the Zones section of the configuration screen.

PHP code:  This snippet can be placed within your theme’s template files.

Post code:  This snippet can be placed within a post or page where you want the ad to display.  You’ll need to switch to the HTML tab of the editor to insert it. 

Problems With Sidebars

I find that the post code does not work in sidebars, but the php code does if you insert it into an Advanced Text widget.  The download link for that plugin is above.  The Advanced Text widget works just like the normal Text widget, but it allows you to insert PHP code.

Share
Artisteer - Wordpress Theme Generator
Archives
Blog Theme Generator

Artisteer - #1 Blog Theme & Web Template Generator

Get Free Traffic

Blazing fast WordPress hosting. Host unlimited sites on unlimited hosting space. Free domain & setup. Only $3.95/mo.