Some doubts about how to show posts in a custom theme?

get_template_part() is including a template file from the active theme directory. For example: get_template_part(‘content’) will include the template content.php from the theme folder. When having two parameters, it will search for a template named firstParameter-secondParameter.php. So: get_template_part( ‘content’, get_post_format() ); will include the content-{$post_format}.php file. get_post_format() returns one of this defined formats: aside chat gallery … Read more

Does get_template_part pull data once in a loop?

get_template_part() calls locate_template(), and both functions are running file_exists() checks for the same file over and over. There is no caching. Meh. But … PHP has an internal cache for file look-ups, so a direct file access will not happen on every call. There is an edge case, most developers aren’t aware of: A file … Read more

Problem with using get_template_part() in footer

It looks like the code in contactform.php may be causing issues. These lines, specifically: global $wp; wp_redirect(home_url($wp->request)); exit; The exit statement may be stopping execution of the rest of the script. If you want to process form data, you should be checking for it and processing it instead of just running the redirect and exit … Read more

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