Tag Info

Hot answers tagged

15

The "classic" TinyMCE editor has two dropdowns: formatselect for paragraph styles and styleselect for character styles - which can also contain paragraph styles, to make it more confusing. The configuration in WordPress by default only shows the format dropdown. If you apply a custom stylesheet to the editor, TinyMCE can use it to pick up the classnames and ...


12

I created a Kint plugin that works really well. I also integrates with the Debug Bar plugin. You can download it at: http://wordpress.org/extend/plugins/kint-debugger/ There are a few functions to help you out with WordPress specific globals: dump_wp_query() dump_wp() dump_post() For printing arrays in a styled, collapsible format you would do the ...


8

I ran into this problem a year or so ago, and found a fix here. Open PHP.INI in a text editor of your choice (normally you can find php.ini in your php install dir) Change the recursion limit to 200x normal, that is, set: pcre.recursion_limit=20000000 Change the backtrack limit to 100x normal, that is, set: pcre.backtrack_limit=10000000 Stop and start the ...


8

There actually are several ways to handle the Wordpress editor wrapping shortcodes in <p> tags. This code shows probably the simplest way to do it...just a simple and short function you need to drop into your functions.php file. Once you do, no more tags around your shortcodes that are on their own line! function wpex_clean_shortcodes($content){ ...


7

You can install and use Krumo with WordPress (or any php app really). there's the Hikari Krumo plugin that simplifies use, though check the comments there, there's an error that you'll need to manually fix to get it working with latest WP. There's also the WordPress Debug Bar plugin which you might find useful. EDIT- Another option I've recently discovered, ...


7

I'm using something like this: date('F, Y', strtotime($data[0]->post_date));


7

wordpress.com supports code syntax-highliting. You can read all about it here: http://en.support.wordpress.com/code/posting-source-code/ for your specific example use: [sourcecode language="java"] package com.jameselsey.domain; import java.util.ArrayList; import java.util.List; import com.google.android.maps.GeoPoint; import android.app.Application; /** ...


7

The default content type is 'text/plain' which does not allow using HTML. You can set the content type of the email by including a header like "Content-type: text/html" $headers = 'Content-type: text/html;charset=utf-8' . "\r\n"; $headers .= 'From: XXXXXX.com <info@xxxxx.com>' . "\r\n"; $subject = 'Registration from xxxxx.com' . "\r\n"; ...


6

If this is how it looks: <img class="alignleft size-medium wp-image-8530" alt="..." src="#" width="413" height="275" /> <img class="alignleft size-medium wp-image-8529" alt="..." src="#" width="413" height="275" /> Then you have to put them together like this: <img class="alignleft size-medium wp-image-8530" alt="..." src="#" width="413" ...


6

If you look at the page source, you'll see that <body> has been given a class page-id-1199. You can use that in your stylesheet to specify styles for that page alone. .page-id-1199 #map { /* custom styles */ }


5

Yes you can. It's [code] *your code here* [/code] and you can even hint the language: [code lang="php"]<?php echo 'test'; ?>[/code]. This is the method I prefer (quick to write). There seem to be other ways as the following resource explains: Support: Code » Posting Source Code (wordpress.com)


5

This is one of the reasons why HTML markup is removed from excerpts in the first place, to prevent such issues like this from occurring however, where there's a will, there's a way... You can, through using regular expression, close the open tags applicable to the excerpt only and you might want to take a look at the following link for some ideas, Close ...


5

Alright so I've already updated this question a ton and it's starting to get overloaded, so I figured I'd write this as an answer even though it isn't a full one. Extrapolating from @bueltge's answer, I actually went back and found his previous post in question. In that post, there was a plugin listed that I've never seen before: "Preserved HTML Editor ...


5

For this kind of stuff, I wrote REF (requires PHP 5.3). Among many other features, it displays contents of DocBlock comments and linkifies PHP-internal classes, methods and functions (links point to the PHP manual). It also handles WordPress functions (links point to queryposts.com). Here's the output of $GLOBALS at the setup stage of WordPress in HTML mode ...


4

I think your question is a perfect example for the XY Problem. In WordPress you do not create such a menu in a post editor. You use a menu. Once you start thinking about your problem from this point, everything is easy. :) First register a custom navigation menu for this list in your theme’s functions.php: add_action( 'wp_loaded', ...


4

I’ve done something similar taking the simple approach of adding a CSS class to titles based on their character count. That CSS class then decreases letter-spacing and/or font-size. // Count the characters, taking Unicode into account $chars = mb_strlen($post->post_title); // For every 10 characters after the first 20, add a size $size = max(0, ...


4

After you post your content, WordPress will pass the_content() function through a number of filtering function's. There are four of them, wptexturize(), convert_smilies(), convert_chars(), and wpautop(). All of these are defined in wp-includes/formatting.php and are referenced in wp-includes/default-filters.php. To remove these filtering functions you can ...


4

There is a clue in wp-includes/formatting.php in the function wptexturize: $default_no_texturize_shortcodes = array('code'); ... $no_texturize_shortcodes = '(' . implode('|', apply_filters('no_texturize_shortcodes', $default_no_texturize_shortcodes) ) . ')'; Try using this filter to add a shortcode to the array: function my_no_tex( $shortcodes ) { ...


3

To format number, you can use the function number_format_i18n (it's not documented now, but you can see its source here). Its work is format the number based on the language. You might want to look at number_format (PHP built_in function, and is used by number_format_i18n) to have more control to decimal point and thousand separator. In your case, this code ...


3

applying the 'the_content' filter could work: <?php echo apply_filters('the_content', $comment->comment_content); ?>


3

The plugin TinyMCE Excerpt adds the Visual Editor to the Excerpt field. http://wordpress.org/extend/plugins/tinymce-excerpt/


3

The wp_title() template tag does some context-based output. From the Codex: The title text depends on the query: Single post or a Page the title of the post (or Page) Date-based archive the date (e.g., "2006", "2006 - January") Category the name of the category Author page the public name of ...


3

Use get_post_class() when you want the values to be returned rather than echod.


3

Try accessing the $post object inside your loop, and echo'ing the content from that. Something like: <?php echo $post->post_content ?> Edit If you need to parse shortcodes, use do_shortcode(): <?php echo do_shortcode( $post->post_content ); ?>


3

Use number_format_i18n( $number ). It will format the number with respect to the current blog’s language setting. It is a wrapper for PHP’s native number_format().


3

In your functions.php: remove_filter( 'the_content', 'wptexturize' ); And the same for the_excerpt or the_title (if required).


3

I know exactly how you feel, and sadly this problem is rooted in the wordpress core code not in TinyMCE or due to browser compatility problems. I wrote a plugin that allows you to format html markup in the HTML editor, switch back and forth between it and the Visual tab without affecting the source code, and make changes in the Visual tab without breaking ...


3

At first, I think this problem was solved since WP version 3.5; see ticket 19666 in trac. But the tinyMCE have a hook there give us the chance to change the content inside the editor and you must not parse on output on frontend. A small source script. I have no test this with a current WP version, was a older solution for a customer. Add this source via ...


3

The excerpt is created in -> wp-includes/formatting.php with this code: function wp_trim_excerpt($text) { // Fakes an excerpt if needed global $post; if ( '' == $text ) { $text = get_the_content(''); $text = apply_filters('the_content', $text); $text = str_replace('\]\]\>', ']]&gt;', $text); $text = ...


3

Wordpress automatically ads the <p> tags to the content. So it shows up while loading the content. This is with the filter wpautop. So we will remove this filter for the image post type only. You can manage this by adding the following code in functions.php file. // Add the filter to manage the p tags add_filter( 'the_content', ...



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