How to add a class to a link in text editor

You can use third party free WordPress plugin “Extend Link“. You can activate this plugin and add extend link as shown in below screenshot. Now when you click on “Extend Link”, you will see the popup similar to default link popup but with an additional option to add IDs, Class and Rel. https://wordpress.org/plugins/extend-link/ Please let … Read more

printf and _n in this example?

The _n (see Codex) function accepts four arguments. The first two are texts to be translated (the first is singular, the second plural), the third argument is a number (in this case $count). When $count is 1 the first string is used, otherwise the second string is used. So in fact the first instance of … Read more

Adding a custom line of text to php code

In the insert_posts function, before the line $post_id = wp_insert_post( $post ); add the following (and suit to your needs): Link to Twitter User Page $post[‘post_content’] .= ‘<a href=”http://twitter.com/__USERNAME__”>’ .’Follow me on Twitter’ .'</a>’; and/or Link to Twitter Status $post[‘post_content’] .= ‘<a href=”‘.$post[‘twitter_permalink’].'”>’ .’View this post on Twitter’ .'</a>’;

Displaying fractions in text

We can paste <sup>3</sup>⁄<sub>16</sub> into the visual editor or write the HTML in the code editor: <!– wp:paragraph –> <p>Testing <sup>3</sup>⁄<sub>16</sub> fraction</p> <!– /wp:paragraph –> or use the subscript and superscript on the text paragraph selections in the visual editor:

Hide content-box on specific pages (in admin)?

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 == ‘template_name.php’){ remove_post_type_support( ‘page’, ‘editor’ ); } } } add_action(‘init’, … Read more

Display only text to WordPress loop without loosing the text formatting

Try this code in your theme’s functions.php file- function filtered_content($content){ $content = preg_replace(“/<img[^>]+\>/i”, “”, $content); // removes images $content = preg_replace(‘/<iframe.*?>/’, “”, $content); // removes iframes return $content; } add_filter(‘the_content’, ‘filtered_content’); This will remove img and iframe tag from your content. Then use the_content() in your template.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)