Customise the Category Widget

You can use any of the parameters from wp_list_categories and the widget_categories_args filter You can style the output with these CSS selectors: li.categories { … } li.cat-item { … } li.cat-item-7 { … } li.current-cat { … } li.current-cat-parent { … } ul.children { … }

WP function duplicating body content

Add a new filter expression immediately after the <body> tag. Like the following <body <?php body_class(); ?>> <?php echo apply_filters(“immediately_after_body”,””);?> Now in your functions.php add the filter hook like this add_filter(“immediately_after_body”,”my_function”); function my_function(){ //do your calculation return “<h1>output from Filter Hook</h1>”; } You can see the output immediately after <body> tag. Use filters, they were … Read more

failing to display a custom font [closed]

@Mike94, Upon looking at your site I noticed this while viewing the style.css file (wp-content/themes/mima/style.css?ver=325): @font-face { font-family: Proxima; src: url(../fonts/ProximaNova-Regular.otf); } Thus, what is being asked for is wp-content/themes/mima/../fonts/ProximaNova-Regular.otf (which does not exist); however, I did find the font file by removing the ../ from the src. However, on viewing your site, I also … Read more

Creating custom page template

Assuming that you’re on a page template or a custom page template, the first thing you want to do is grab the current page ID, then use that ID to grab the children. Once you have the children, display the content for those children. Try using get_children(); You can also try get_page_children but for my … Read more

Replace a ‘Title’ tag with a Custom Field

You will want to read up on get_post_meta(). Here is a link to the WP Codex reference for that function. <?php $meta_values = get_post_meta( $post_id, $key, $single ); ?> If you created that custom field with something like Elliot Condon’s ACF plugin, the documentation for the plug-in is also helpful in meeting your exact need. … Read more

How to assign a custom post title to be the post ID?

You could set it to the post ID when the post is first created via the default_title filter. function wpd_default_title_filter( $post_title, $post ) { if( ‘your_post_type’ == $post->post_type ) { return $post->ID; } return $post_title; } add_filter( ‘default_title’, ‘wpd_default_title_filter’, 20, 2 );