How to change header image size in custom themes

If you’re using Twenty Eleven, just add this to your functions.php file and you should be good to go: remove_filter( ‘HEADER_IMAGE_WIDTH’, ‘twentyeleven_header_image_width’ ); remove_filter( ‘HEADER_IMAGE_HEIGHT’, ‘twentyeleven_header_image_height’ ); define( ‘HEADER_IMAGE_WIDTH’, apply_filters( ‘child_header_image_width’, 1700) ); define( ‘HEADER_IMAGE_HEIGHT’, apply_filters( ‘child_header_image_height’, 300) );

How can I edit the content in index.php? [duplicate]

If you are editing a theme or you are having a child theme, You can make your own custom template, give it a name Include header and footer in it using <?php /** * Template Name: Home Page * * Home page Layout */ get_header(); ?> <!– Do whateveer you want here –> get_footer(); ?> … Read more

Template issues getting ajax search results

When you load a template file directly that way, you’re not loading the WordPress environment, so no WordPress functions are available. Your two options are to either load the search page on the front end and filter the result, like: $(‘#results’).load(‘http://mysite.com/?s=searchterm ul#target’); Or build a search function using WordPress provided AJAX functionality, see AJAX in … Read more

get_template_directory() still returning path to previous theme

The get_template_directory() and get_template_directory_uri() functions don’t actually echo anything at all. They will make no output at all unless you echo them. So your code that looks like this: <img class=”frontpageimg” src=”https://wordpress.stackexchange.com/questions/119910/<?php get_template_directory(); ?>/images/slogan-2.png”> Should actually cause this output: <img class=”frontpageimg” src=”https://wordpress.stackexchange.com/images/slogan-2.png”> Which may not be what you’re expecting. Examine the source of the page. … Read more

page-name.php doesn’t execute on custom template

Don’t name your custom page template files page-{foobar}.php. Doing so will cause just this conflict with the Template Hierarchy for static pages: custom template file – The Page Template assigned to the Page. See get_page_templates(). page-{slug}.php – If the page slug is recent-news, WordPress will look to use page-recent-news.php page-{id}.php – If the page ID … Read more