Viewing 2 posts - 1 through 2 (of 2 total)
    • Author
      Posts
    • hotstreak
      Guest

      I have a blog where all of my categories are the 50 states of the United States. Much of my content has more than 1 category. What I am looking for is a way to replace the “state” name in each post. For example:

      Filed under categories “Pennsylvania” and “Florida” is the post:


      Buyers are enticed by the ‘almost too good to be true’ prices they see on short sales and foreclosures. I’ve found that many buyers don’t really understand the downsides to these types of deals and will do my best to give you some basic information to help you make better decisions. You’ll want to know enough about this so that whether you are considering buying Clearwater homes or Dunedin condos you’ll be better prepared for the typical issues that can come up.


      But I want it to look like:

      [state]Buyers are enticed by the ‘almost too good to be true’ prices they see on short sales and foreclosures in [state]. I’ve found that many buyers in [state] don’t really understand the downsides to these types of deals and will do my best to give you some basic information to help you make better decisions. You’ll want to know enough about this so that whether you are considering buying [state] homes or condos you’ll be better prepared for the typical issues that can come up in [state].

      So, when someon visits the post under the Pennsylvania category, it looks like:

      Pennsylvania Buyers are enticed by the ‘almost too good to be true’ prices they see on short sales and foreclosures in Pennsylvania . I’ve found that many buyers in Pennsylvania don’t really understand the downsides to these types of deals and will do my best to give you some basic information to help you make better decisions. You’ll want to know enough about this so that whether you are considering buying Pennsylvania homes or condos you’ll be better prepared for the typical issues that can come up inPennsylvania .

      And the same would be for Florida or whatever state (category) page my visitors are on.

      Can someone please point me in the right direction??

      TY

      I think this is not an issue with Shortcoder wordpress plugin. This is an unrelated topic related to this plugin.

      Anyway, the solution is … you have to add this code to the functions.php file in your theme directory anywhere:

      Code:

      function shortcode_print_category( $atts ) {
      return single_cat_title();
      }
      add_shortcode( ‘state’, ‘shortcode_print_category’ );


      I’ve not tested but should work.

    Viewing 2 posts - 1 through 2 (of 2 total)
    • The topic ‘I need help with Shortcoder!’ is closed to new replies.

    Subscribe for updates

    Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter