I'm trying to insert a dropdown (via HTML string) in to every post
I have.
I'd like to add it before the post information, but below the website nav. bar and header.
In the screenshot, you'll notice it's added to the very top. I want it to be moved in the designated area.
So, you can see the "Choose an Article" and dropdown are at the top-top. I would like them inserted just before the Content (where <div id="content">
).
Current code:
add_action('wp_head', 'append_header');
function append_header(){
//Close PHP tags
?>
<script type="text/javascript" src="/wp-content/themes/grow-minimal-child/customjs.js"></script>
<?php //Open PHP tags
$args = ['post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => -1];
$titles = get_post_titles($args);
$dropdown = create_dropdown_html($titles);
echo $dropdown;
}
I've tried also using the_content
and appending the $dropdown
html to that, but this just inserts the drop down after the "Test Post Please Ignore" and post info line. See this screenshot
How do I place the code to hook after the header and nav bar, but before the content itself?