- This topic has 7 replies, 2 voices, and was last updated 3 years, 2 months ago by Elvin.
-
AuthorPosts
-
February 7, 2021 at 8:20 pm #1649718nurban01
Hi,
Not 100% this is a GP issue, but I think it is related.
For some reason, right after:
<nav id="site-navigation" class=" main-navigation grid-container grid-parent sub-menu-right"
I have the following #text now displaying in my site header (but only within Posts).document.querySelector("h2");
I searched through my full WP install with the String Locator plugin and also tried in another browser. Any ideas?
February 7, 2021 at 10:03 pm #1649741ElvinStaffCustomer SupportHi there,
You seem to have something that hooked this string to
generate_inside_navigation
.Can you check for any Hook Element that has this string in it?
If you have Code Snippets plugin and/or functions.php snippets, you can also check for any code that has something like this:
add_action('generate_inside_navigation',...
Let us know.
February 8, 2021 at 9:12 am #1650630nurban01Found it, thanks! How did you know where to check?
February 9, 2021 at 12:16 am #1651251ElvinStaffCustomer SupportFound it, thanks! How did you know where to check?
It’s from familiarity with the theme’s hooks, experience + chrome devtools.
Just by inspecting the page’s code using Google Chrome’s devtools, when something shows up on a certain part of the site, we already have an idea of how it’s placed there.
We actually have some sort of a hook “map”. See our Hook Visual Guide: https://docs.generatepress.com/article/hooks-visual-guide/
No problem. Glad you got it sorted.
February 9, 2021 at 12:37 pm #1652202nurban01we already have an idea of how it’s placed there.
I’m familiar with Chrome’s Devtools. I’m especially curious how you knew that it was inserted from a hook rather than a core theme file, plugin, PHP snippet, etc. I didn’t see any references to hooks around the text.
February 9, 2021 at 3:46 pm #1652350ElvinStaffCustomer SupportI’m familiar with Chrome’s Devtools. I’m especially curious how you knew that it was inserted from a hook rather than a core theme file, plugin, PHP snippet, etc. I didn’t see any references to hooks around the text.
Our reference is where the things appear within the HTML structure.
Since we’re familiar with what the default elements are used by the theme, we usually know what elements are either filtered or hooked in.
Say for example, if something appears before the
<header id="masthead">
element. Looking at the Hook visual guide, we already have an idea that it’s either hooked togenerate_before_header
orwp_body_open
even when there’s no reference or clue html tags like<!--comments-->
because the fact that it appears before<header id="masthead">
is the clue. 🙂So to put simply, if something isn’t a “default” element of the theme, it’s most likely hooked in, filtered or there’s a child theme template involved. 🙂
February 9, 2021 at 7:33 pm #1652459nurban01Great explanation, thanks! Hope that this helps someone else too 🙂
February 9, 2021 at 8:22 pm #1652474ElvinStaffCustomer SupportNo problem. Glad to be of any help. 😀
-
AuthorPosts
- You must be logged in to reply to this topic.