Display posts from a specific category on frontpage.php template?

Take a look at multiple loops for examples And also look at the content.php file in the Twenty Fourteen theme <?php // The Query $category_query = new WP_Query( ‘category__in=11’ ); // The Loop if ( $category_query->have_posts() ) { echo ‘<ul>’; while ( $category_query->have_posts() ) { $category_query->the_post(); echo ‘<li>’ . get_the_title() . ‘</li>’; } echo ‘</ul>’; … Read more

How to display only the first 2 words of a post title

You can use “wp_trim_words” function for this case. Exam: To display the first two words. echo esc_html(wp_trim_words( get_the_title(), 2, ” ) ); Use this code within your H1 tag. You can control the number of words you want to show in the title by changing the second parameter of the function “wp_trim_words” to know more … Read more

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