Tag Info

Hot answers tagged

3

I ended up using userabuser's answer with a small modification, because global $post doesn't seem to exist on init. You can instead just query for post in querystring, like so: function remove_editor() { if (isset($_GET['post'])) { $id = $_GET['post']; $template = get_post_meta($id, '_wp_page_template', true); if($template == ...


2

There is a difference between the home page and the front page. Since the code uses is_front_page I assume that is what you want, but check the Codex for the difference. I don't know how your theme works, but it looks like the theme rolls several things into the "info bar". The code you posted just checks to see if there is any reason to display that bar. ...


2

Are you sure editor use <i> for italics? I'm almost sure it uses <em>. However, if you want to be absolutely sure there are no <i> in your post content, let editor do what it want and then replace <i> with <em> before creating/updating posts, hooking wp_insert_post_data filter, just like: ...


2

Text its just plain text, just as its saved in your db. Wordpress changes line breaks with paragraphs with the function wpautop, through the filter the_content and the_excerpt. If you need to remove the wpautop behavior, you can remove the filter by doing this in your theme's functions.php: remove_filter( 'the_content', 'wpautop' ); remove_filter( ...


1

You code works where the function the_excerpt is used. It does not work when get_the_excerpt is used, which does not apply the the_excerpt filter. It applies get_the_excerpt instead. Using get_the_excerpt will cause the filter to apply to both the cases since the_excerpt() uses get_the_excerpt(). Automatically generated excerpt content is a different thing ...


1

I would create a separate option that will be called in the template. And i would make an options page also. Here is a TUTORIAL i followed and succeeded in creating my options pages for multiple themes .


1

I just slightly modified @Bainternet's answer. Using a switch on post_type, it's even possible to redirect to different templates. The default will let wordpress ignore the my_print parameter and go on as usual. add_action("template_redirect", 'my_template_redirect_2322'); // Template selection function my_template_redirect_2322() { global $wp; ...


1

this string is displayed when you get a nonce mismatch, something that should not happen much under normal usage. If it does haen enough to make you aware to it then you should investigate the cause. Anyway, no easy filter for that string so you will have to use the translation api to replace it. add_filter ( 'gettext', 'wpse_120304', 10, 3 ); function ...


1

Looking through the docs reveals that you can either disable that slider all together, or add your own slides in it which will replace the default text that you see now. To add your own slides, use the instructions here: http://siteorigin.com/pitch-documentation/content/home-page-slider/ To disable the slider you should probably hunt for the option. I'm ...


1

If you really want to execute code stored in a database, a quick google search reveals that you can use the eval() function to do just that. However, many people do say that Eval is Evil... Instead of storing the entire PHP code of an option in the database, try storing a simple boolean flag for your option and then test whether to get your template's ...


1

It's a PHP issue. The character ' is being escaped so that it can be safely in various places, not least of which is the database. That's why your ' look like \'. You can use PHP's stripslashes() function to clean it up, or (if it's an array you need to clean up) WordPress's stripslashes_deep() function.


1

While I rarely recommend plugins, the CKEditor plugin will do highlighting of selected text. That sounds like exactly what you want. And it is a greatly enhanced editor relative to the default one. Short of creating your own editor buttons and supporting functions, that would be a pretty good choice.



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