I can’t add CSS with functions.php

Before adding any file you must seperate your header.php file & add wp_head() function in header.php file // Load the theme stylesheets function theme_styles() { // Example of loading a custom css file for homepage just on the homepage wp_register_style( ‘custom’, get_template_directory_uri() . ‘/css/custom.css’ ); if(is_page(‘home’)) { wp_enqueue_style(‘custom’); } // Example of loading a main … Read more

home.php show blog posts as grid view

It’s a little bit hard to guess, what exactly do you want to achieve (you’ve mentioned something about four posts in a row and then there is number 6 in your for loop), but… If you want to display only 4 posts in your loop, then you can use current_post field of $wp_query, so the … Read more

How to place POST TITLE any location inside the posts page

Assuming that you place it within “The Loop”, you can use the_title() function, which will display the title. See https://codex.wordpress.org/Function_Reference/the_title . The function will not return anything outside of “The Loop”. Note that get_the_title() is similar, but does not display the title. If you used that function, you would echo get_the_title() . Note also that … Read more

Modify available templates (in dropdown)

The list of available templates is generated by get_page_templates. By the end of this function you see a filter that allows you to modify the output. You can use that to change it under certain conditions like this: add_filter (‘theme_page_templates’,’wpse302574_conditional_templates’, 10, 4); function wpse302574_conditional_templates ($post_templates, $this, $post, $post_type) { $parent_id = wp_get_post_parent_id ($post->ID); if (get_page_template_slug … Read more