New answers tagged

1 vote

WP HTML Templates - Any way to get bloginfo() or the path to the theme folder?

At the time of writing this isn't possible, twentytwentytwo works around this by registering patterns in a subfolder then using a pattern block. This way they can define patterns in PHP then use the ...
user avatar
  • 52.4k
0 votes

What is the first file wordpress looks at in a theme?

I think the more logical path is this: style.css functions.php index.php
user avatar
0 votes

Filter nav menu items HTML tags and wrap inner text with span

Here is my solution with assistance from TheDeadMedic. I added the <svg> code to the replacement value in the preg_replace function, then added the opening and closing <span> tags to the ...
user avatar
1 vote

Filter nav menu items HTML tags and wrap inner text with span

Just use link_before in your wp_nav_menu $args and add opening/closing span tags: $args = [ 'link_before' => '<span>', /* Add closing </span> to link_after */ 'link_after' =&...
user avatar
  • 35.5k
0 votes
Accepted

setcookie on WordPress Page Template

This fails because the init hook is far too early to call is_page_template. Conditionals such as this function use the main query to decide their value, but WordPress hasn't created the main query yet....
user avatar
  • 52.4k
1 vote

registering a global template wordpress 6.0

but now in WordPress 6.0, there is no such attribute that exists in Gutenberg to select a new page template. This is not true! WP 6.0 did not remove this functionality. In fact in the block editor it ...
user avatar
  • 52.4k

Top 50 recent answers are included