Tag Info

Hot answers tagged

5

A long time ago WordPress did not put feed links into the head element automatically. Theme or plugin authors had to do that. In 2009 automatic_feed_links() was introduced, a function that should be used in themes or plugins to let WordPress do the hard work. One year later it was added to Twenty Ten, and it became a de facto standard. Not much later ...


3

You need to use one add_theme_support() call for each feature. Per the Codex, the proper function call is: add_theme_support( $feature, $arguments );


3

add_theme_support( $feature, $arguments ); as you can see have two parameters, $feature and $arguments. $feature is the feaure you need to add theme support for. This parameter doesn't accept an array, only a string. So you would have to add a add_theme_support for every feauture that you would like to include in your theme. In your question, it is ...


3

You can do it with something like this: add_action( 'init', 'wpse48017_remove_tags' ); function wpse48017_remove_tags() { global $wp_taxonomies; $tax = 'post_tag'; // this may be wrong, I never remember the names on the defaults if( taxonomy_exists( $tax ) ) unset( $wp_taxonomies[$tax] ); } There was a move to get a function ...


3

Use remove_post_type_support to disable features for specific post types. add_action( 'init', 'wpa63635_init' ); function wpa63635_init() { remove_post_type_support( 'post', 'thumbnail' ); }


2

To use a custom font, simply upload the font to your theme folder and then add a CSS @font-face declaration to the top of your theme's style.css file pointing to the new font: @font-face { font-family: CustomFont; src: url('CustomFont.ttf'); } You can then reference that custom font in other CSS styles, for example: .entry-content { font-family: ...


2

Since you appear to be using Featured Images, replace this: <div class="post-image"> <?php echo ravs_get_custom_image( get_post_thumbnail_id () ); ?> </div><!-- end post-image --> with this: <div class="post-image"> <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'custom-image' ); ...


2

If you check the source ... 1361 /** 1362 * Allows a theme to register its support of a certain feature 1363 * 1364 * Must be called in the theme's functions.php file to work. 1365 * If attached to a hook, it must be after_setup_theme. 1366 * The init hook may be too late for some features. 1367 * 1368 * @since 2.9.0 1369 * @param string ...


1

There are a couple of things to check here. First, make sure that add_theme_support( 'post-thumbnails' ) is loaded before add_image_size( 'small-thumb', 60, 60, true ) You can always hook everything through a function to the after_setup_theme hook. I always add these in my theme setup function function wpse_setup_theme() { add_theme_support( ...


1

This should get you going in the right direction. Not my solution, slightly modified from here. You'll need to swap out your-post-type for the post type you're using. function adjust_post_formats() { if (isset($_GET['post'])) { $post = get_post($_GET['post']); if ($post) $post_type = $post->post_type; } elseif ( ...


1

Chances are, the theme you are using does not take into account the Custom header settings when it puts in the Site Title and Description. I would suggest (if you are comfortable in PHP) creating a child theme (as described here) for your theme, then copy header.php into your child theme and remove/alter the area where it puts in your Site Header. For more ...


1

I have added this code to my header.php and it worked nicely: #header a{ <?php if(get_header_textcolor()=='blank') { echo 'visibility: hidden;'; } else { ?> color:#<?php echo get_header_textcolor(); } ?> }


1

Have you tried adding 'type' => 'click' under 'footer' => 'page', to see if the Jetpack works with click rather than the default scroll? It is also worth going to Settings -> Reading in the admin panel... does it say "To infinity and beyond....We've disabled this option for you since you have footer widgets in Appearance → Widgets, or because your ...


1

You have to register the sidebars in the parent theme just late later enough. Use a hook that runs later, and child themes can register their theme support. Child theme add_action( 'after_setup_theme', 'register_header_sidebar_support' ); function register_header_sidebar_support() { return add_theme_support( 'header-sidebar' ); } Parent theme ...


1

There is no specifier in your sprintf, so it won't output anything. Try: sprintf('Views: %d', get_PostViews(get_the_ID())), You may have to use %s instead, it depends what your get_PostViews function is returning.


1

Error 500 is very generic and can be caused by numerous underlying issues. Your first step should be locating error log for your hosting account or asking support to help with that. My weak guess would be that your file gets created with file permissions that are not secure enough to hosting configuration.


1

Your add_theme_support() call syntax is incorrect. It should be: add_theme_support( $feature, $callback ) Where $feature = 'admin-bar', and $callback = 'callback_function_name' Have you defined a callback? More importantly: are you absolutely sure you even need to enable Theme support for this feature? It is only required for overriding the default ...


1

Memory is not the issue here. There are no complex operations, and the difference will be almost unmeasurable. What matters is readability: If your stuff function is rather short (less than eight functional steps) and you use the check just once – keep the check in it. But if you need the support check in different functions separate it. I'd rather ...


1

try running your code with a lower priority: add_action( 'after_setup_theme', 'my_twentyeleven_setup', 20 ); function my_twentyeleven_setup(){ add_theme_support('post-formats', array( 'aside', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video', 'audio', )); }


1

Not really sure what you're asking here, but this allows theme support for navigation menus in your theme. Place this block of code in your theme's functions.php file. if(function_exists('register_nav_menus')){ register_nav_menus( array( 'header_navigation' => 'Header Navigation', 'main_navigation' => 'Main ...


1

Hopefully someone will expand on this a bit more, but here goes: add_theme_support('automatic-feed-links') in your functions.php file, adds code (<link rel="alternate"...) to the <head> of your pages which links to the relevant RSS feed for that pages content. This is generally preferred to add code like this in WordPress than to put it in ...



Only top voted, non community-wiki answers of a minimum length are eligible