Problems with loop

the_post() function is what advances the internal counter and loads the data for the next post. You’re calling it between the title and content: the_title(); the_post(); the_content(); You want to change the order and move it before the output of any of the other template tags: the_post(); the_title(); the_content();

Get_template_part inside a folder

I assume you have a file in templates/masterhead-templatename.php, and it works, it is ok. Correct me if I am wrong, you want to locate this file like this masterhead-templatename.php, basically one folder up, but this wordpress function does not work like this. If the file exists in the root’s theme folder, it does not recognize … Read more

add a hook with get_template_part()

OK, so one simple way would be to edit your template, I assume header.php for where you want the menu to appear. Use the template include to load myfile.php get_template_part(‘template-parts/myfile’); Then inside myfile.php: <?php $search .= ‘<li class=”search”><form role=”search” method=”get” id=”searchform” action=”‘.home_url( “https://wordpress.stackexchange.com/” ).'”><input type=”text” value=”search” name=”s” id=”s” /><input type=”submit” id=”searchsubmit” value=”‘. esc_attr__(‘Search’) .'” /></form></li>’; … Read more

get_template_part and template file names

Codex has very decent explanation of get_template_part() logic: Assuming the theme folder is wp-content/themes, that the parent theme is twentyten, and the child theme is twentytenchild, then the following code — <?php get_template_part( ‘loop’, ‘index’ ); ?> will do a PHP require() for the named files in this order: wp-content/themes/twentytenchild/loop-index.php wp-content/themes/twentytenchild/loop.php wp-content/themes/twentyten/loop-index.php wp-content/themes/twentyten/loop.php Basically you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)