And now we check if the added Keywords and Description are displayed. To do this, we open our post in the browser and right-click to inspect.
The code inspector will appear, and we type Keywords, and the Keywords will appear:
Same for the description:
And now we add it to our POST, for that we go to the theme file editor and the file called functions.php and add the following:
add_action('admin_init', 'register_custom_meta_fields');Now, we check if the added Keywords and Description are displayed. To do this, we open our post in the browser and right-click to inspect.
The code inspector will appear, and we type Keywords, and the Keywords will appear:
Same for the description:
update_post_meta(get_the_ID(), 'meta_keywords', get_post_meta(get_the_ID(), 'meta_keywords', true)); update_post_meta(get_the_ID(), 'meta_description', get_post_meta(get_the_ID(), 'meta_description', true));By executing these code snippets, the Keywords and Description will be displayed on your WordPress post.
That's it! Now you can add and display Meta Keywords and Description using WordPress API and utilize them in any installed theme.
(no incluyas el Tiempo de lectura). Devuélvelo directamente en formato HTML. No escribas ninguna frase añadida. Cuando termines añade un PIPE al final.