Tag Info

New answers tagged

1

WordPress 3.9 introduces a theme_page_templates filter. The example below from a Twenty Fourteen child theme functions.php shows how to remove the "Contributor Page" template: function tfc_remove_page_templates( $templates ) { unset( $templates['page-templates/contributors.php'] ); return $templates; } add_filter( 'theme_page_templates', ...


1

You can simply add this code to your child themes functions file and change the values for the width and the height. Depending on your theme, you may also need to modify the values in your style sheet for different header elements however based on my testing, this is not needed when using a Twenty Fourteen child theme. add_theme_support( 'custom-header', ...


1

The is a filter to the custom header function in the twenty fourteen theme. You can use that to add your new sizes. Here is what I use to change the default size. function wpse_custom_header_setup() { add_theme_support( 'custom-header', apply_filters( 'wpse_header_args', array( 'width' => 1460, 'height' ...


1

The hooks you are looking for can be found in the WordPress Codex WP_Query - Filters: Filters posts_distinct - Alters SQL 'DISTINCTROW' clause to the query that returns the post array. posts_groupby - Alters SQL 'GROUP BY' clause of the query that returns the post array. posts_join - Alters SQL 'JOIN' clause of the query that returns the post ...


0

The first line is just an HTML comment outside the scope of PHP. It'll output with every response and creates all the kinds of headaches you're experiencing. Solution? Remove it, or make it a PHP comment: <?php /* In a child theme, all of the functions of the parent theme are present, unless overridden here */ You should also make sure there's ...


0

I also working on ait theme template, If you want to add new css & js file into child theme so u first create function.php file in child theme directory & after that u can write following code... <?php define('CHILD_THEME_DIR', get_bloginfo(stylesheet_directory)); /* this is my child theme css folder */ define('CHILD_THEME_CSS_DIR', ...


1

What I would do is create a parent theme that is used on one site and a child theme of that theme for all other sites. In the parent theme's header a you would do a regular wp_nav_menu() call to build your menu, except you wouldn't echo it. Instead return the menu into a variable, pass that to update_option and then echo it. In your child theme's ...


1

The parent theme's functions.php will load automatically. You don't need to "read" it, and you don't want to "hack" it either manually, which will be overwritten, or programatically, which is very resource intensive. Your theme is enqueueing the script on the wp_head action. You just need to remove that callback and add a slightly modified one. The trick ...


0

You can use remove_action to remove a particular action done by your parent theme (within your child theme, before adding your own action to that hook [wp_head]) and then add your own action with add_action in your child theme. References: Remove Action Add Action


1

Try these filters instead // changing the logo link from wordpress.org to your site function mb_login_url() { return home_url(); } add_filter( 'login_headerurl', 'mb_login_url' ); // changing the alt text on the logo to show your site name function mb_login_title() { return get_option( 'blogname' ); } add_filter( 'login_headertitle', 'mb_login_title' ); ...


3

Try get_stylesheet_directory_uri(); which Retrieves stylesheet directory URI for the current theme/child theme /* == Custom Login Logo ==============================*/ function custom_login_logo() { echo '<style> .login h1 a { background:url('.get_stylesheet_directory_uri().'/images/logo-white.png) 0 0;background-size:218px ...


1

There's a new filter in WP core (3.9) to remove page templates. It can be used from child themes. https://core.trac.wordpress.org/changeset/27297


3

WordPress doesn't store a copy of themes. I see several options: Find out why the creator of the theme doesn't have a copy of the theme at version 2.9. It is really weird that any serious developer wouldn't keep a copy of old versions. Check your own backups. Ask your hosting provider if he has backups. How did you get the theme in the first place? Maybe ...



Top 50 recent answers are included