I have a job archive where a summary of every job is listed. Underneath every single short-description I need the same text-block - containing an email address and a postal address. To make it easier to change content for all entries in case of something changes in that text-block I set up a textarea with ACF plugin on my options page. To protect the email address from crawlers I use the Email Encoder plugin - so I have a shortcode in my textarea content. The problem is: if the shortcode is comming from the options page the rendered shortcode output is exactly the same in every loop. But only if comming from the options page. If I put the same lien having the shortcode in every job description I get the rendered shortcode output like it should > shortcode produces a span with an id and a matching javascript function. When having multiple spans with the same id the javascript function doesn't work anymore.

Why is content comming from an options page textarea processed differently? Any ideas?

Here the (reduced) code I have - (using timber twig):

{% for post in posts %}
{% set copytext = post.job_copytext %}
{% set abschlusstext = options.opt_jobs__bewerbungs_abschlusstext %}

{% include('templates/sections/job-item.twig') with {
    'job_copytext': copytext,
    'abschlusstext': abschlusstext
} only %}
{% endfor %}

{# job-item.twig: #}
<div class="copytext-job-item">
{% filter shortcodes %}
{{ job_copytext|wpautop }}
{% endfilter %}

{% filter shortcodes %}
{{ abschlusstext|wpautop }}
{% endfilter %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.