Ad
Out Putting RAW ACF Values In Twig/timber Unto Page Header For SEO Purposes
So, from ACF I have created my own SEO fields in my custom WP theme, so I don't have to rely on a plugin, and I want to have the default values already filled out, so we don't always have be doing that unless for something specific - how do I out put those unto my page and insert them in the header at the same time? I have tried {{post.meta_description|raw}}
and {{ function('wp_head') }}
timber but it just prints it on the page, what am I missing?
Another great {{ post.tool_brand }} {{ post.tool.type}}
for sale, {{ post.power_type }} of power with a
competitive price {{ post. tool_price }}!
{% extends "base.twig" %}
{% block content %}
<div class="container my-4">
<head>
{{post.meta_description|raw}}
{{ function('wp_head') }}
</head>
</div>
{% endblock %}
Ad
Answer
This here seems to do exactly what I wanted it to do: {{ include(template_from_string(post.meta_description)) }}
ie: <meta name="description" content="{{ include(template_from_string(post.meta_description)) }}">
Ad
source: stackoverflow.com
Related Questions
- → How do I call the value from another backed page form and use it on a component in OctoberCms
- → Print the output value of an array in twig [OctoberCMS]
- → Exception thrown when turning on minify in October CMS
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Display different sidebar content based on page url - October CMS
- → Eloquent Multitable query
- → how to check if today is between two dates in Twig?
- → Get blog post from postlist array october cms?
- → Twig loader crushes with October CMS
- → Accessing third level menu in Static Pages via twig.
- → how to build form_ajax() function with data-request-validate attribute
- → Laravel displaying information in {% content %}
Ad