Can’t print Yoast meta description into page template (syntax error, unexpected ‘.’) [closed]

There is indeed an unwanted ; (semicolon) in your function (try to look at line 99 in the twentytwentyone-child/functions.php file) which likely is the cause to the syntax error. So just remove that ; and the error would be gone: function my_service_template_footer_data() { echo “<script type=”application/ld+json”> { ‘@context’: ‘https://schema.org/’, ‘@type’: ‘Service’, ‘serviceType’: ‘ ” . … Read more

Adding fields to category manager. Does a method exist to get the link to the category edit screen?

The function which is used internally (since 3.1) is get_edit_term_link( $term_id, $taxonomy, $object_type=”” ). Source view here. There’s also a function called edit_term_link that will format the link output for you. The built-in functions are probably better to use, because they check for user capabilities, etc., and are better for future compatability. That said, I … Read more

What action hook can I use to add a JavaScript to a page post using a theme template that is not including get_header() nor get_footer()?

Completely skipping wp_head and wp_footer doesn’t seem like a good idea, many core components and plugins depend on these hooks. Instead, you could create a light header and footer, and load them via an extra argument to get_header() and get_footer(). get_header( ‘light’ ) will load header-light.php instead of the regular header file. Create one without … Read more

Plugin Development/ Stop CSS clashes.

If you don’t know, and can’t control, the content width, then your Plugin shouldn’t assume any given content width. Also, even though templates may be 960px in total width, the content width will almost assuredly be less than that. If you must apply explicit width to your output, you could try returning the value set … Read more