Skip to main content

Overriding a local_link with a permalink

The feeds that appear in the footer areas on many websites that Earnware manages (like Sponsored Stories and Local Articles) need to link to a {local_link} or to a {permalink}. For all the footers we usually use the template=”4″, that has the {local_link} in the template by default. It’s ok to use it, when you want to show off an external source feed, but what to do when you want to show a local feed using template=”4″ that has the {local_link} by default?

So Sponsored Stories Feed shortcode (the external feed) has nothing fancy in it, we covered most of these parameters here:
[feedspress url="" title_override="" skip_items="" item_fields="title,content" feed_fields="content" allowed_tags="" link_item_title="0" template="4" article_detail_template="3" change_to_local_link="true" detail_page="specials" order="random" max_items="3" class_prefix="feedspress" truncate_description="1" ignore_filter="true"]

For local articles (using template=”4″ parameter that has {local_link} by default) we would need to change the shortcode to the following:
[feedspress url="" item_fields="title,content" feed_fields="content" template="4" order="random" max_items="3" change_to_local_link="false" wrap_image_with_link="true"]

In this set-up, we override the template #4 {local_link} with a permalink, by changing the local link to “false” (which makes the {local_link} a permalink): change_to_local_link=”false”. After you change this, the image will no longer be wrapped around a link, to fix this please add wrap_image_with_link=”true”, so the image would be wrapped inside an <a> tag.

Also since the feed items link to local articles you don’t need the following parameters (used to specify the feed item detail and category pages with the detail page template parameter): article_detail_template=”3″ change_to_local_link=”true” detail_page=”specials”;