the_excerpt() in content.php and get_template_part() in single.php

the_content() does not grab the PHP file content.php, it simply displays a Post’s content. Likewise, the_excerpt() grabs the excerpt of a post. get_template_part simply finds a file within your theme named whatever you put in, with an optional suffix. get_template_part( ‘content’ ); // content.php get_template_part( ‘content’, ‘my_page’ ); // content-my_page.php in order for make different … Read more

Single.php – Get Current Parent Category

The very broad answer for why this doesn’t work is that the internet is stateless. Basically each request for a page is a separate and unique instance from other page requests. Example Let’s say post-1 is in category-1 and category-2. When WordPress loads post-1 on single.php it has no way of knowing how the user … Read more

How do I display a custom field from a custom taxonomy in single.php?

Catchable fatal error: Object of class stdClass could not be converted to string in /wp-content/themes/new/single.php on line 22 This is because $wpdb->get_row returns an object by default and you can’t echo an object. Changing echo $toc to echo $toc->meta_value will give you your desired result. Your other problem is that multiple terms can have have … Read more

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