Articles of formatting

Place page title in header?

Normally, in WordPress, the page title appears in the content area. I’d like to have the page title appear in the header area. It looks like to do that, I’d have to remove it from its current location in the content-page.php and place it in header.php. But content-page.php is called from page.php, which calls the […]

PHP library that can merge stylesheet with inline style

I am working with html document generated from Micrsoft Word 2007/2010. Besides generating incredibly dirty html, word also has the tendency of using both block and inline style. I am looking for a php library would merge block into already existing inline style element. I have html converted from Word and will be sending them […]

How to Include HTML in Excerpts?

I use the Leaf theme and I can’t seem to format the home page excerpts. I tried plugins and fiddling around with the theme-functions.php file but to no avail. I don’t need a lot of fancy stuff in the excerpts just a bit of formatting, nothing more. That should be possible, right?

How to prevent automatic conversion of dashes to –

When I put — into a post it is automatically converted to the – – character in the output by wordpress. How can I get normal ‘–‘ double dashes in my content.

Formating the display of a post's date, outside the Loop

I’m using this function to be able to retrieve several data, from outside the Loop: function get_post_data($postId) { global $wpdb; return $wpdb->get_results(“SELECT * FROM $wpdb->posts WHERE ID=$postId”); } … and then, this to display the date a post was published: <?php global $wp_query; global $thePostID; $thePostID = $wp_query->post->ID; $data = get_post_data($thePostID); echo $data[0]->post_date; ?> wich […]

Is there a way to disable formatting shortcuts in 4.3?

Since the WordPress 4.3 version was released there are these new things called formatting shortcuts. They can be helpful but I find them mostly annoying. Is there anyway to disable these new formatting shortcuts? Thanks in advance!

Remove whitespace before the_excerpt();

I need to delete the whitespace that the_excerpt(); function returns me. I noticed it gives me whitespace before the whole text only where in the page images goes first and only after goes text. I tried str_replace(); and trim(); none of them helped.

Why does WP not like my <a> container?

Lately I’ve been working on some shortcodes where all the elements the shortcode produces are wrapped inside an tag. Unfortunately this is not rendered like wanted, because of the filter wpautop on the_content or whatever you’re using to display shortcodes and/or regular content. The setup Imagine that we created the following shortcode: <?php function example_shortcode($atts, […]

Pasting code into pre-formatted text in Visual Editor not working in 3.3.1

Pre-formatted text in the Visual Editor is not behaving like I’m used to. I’ve got an old installation (3.2.1), and when create pre-formatted text, all the line-breaks and spacing is preserved. In the latest version (3.3.1), the line breaks are interpreted as new paragraphs, and the code is broken across those paragraphs, leading spaces removed. […]

When calling wp_title(), do you have to create some kind of “title.php” file?

… or does wp_title() already handle the various contexts in your blog? This could clarify for me how I can achieve a reusable index.php file without having all the conditional statements inside it to handle the different title formats in the given context (page, single, posts, search, archive, date, etc…) Also, Could a specific post […]