Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

How To Style Links in Content Area With Tag Automatically?

If you decided to go that route, this should work. Just add this to your themes functions.php file:

// Add Shortcode
function link_inline_styling( $atts , $content = null ) {

    // Attributes
    extract( shortcode_atts(
        array(
            'url' => '',
            'target' => '',
        ), $atts )
    );

    // Code
return '<a href="'.$url.'" target="'.$target.'" ><span style="font-family:Arial,Verdana;font-size:12px;font-weight:12px;color:#337D98;"><strong>'.$content.'</strong></span></a>';
}
add_shortcode( 'link', 'link_inline_styling' );

and then in your content area you can use the shortcode like this:

[link url="http://google.com" target="_blank"]My Anchor text[/link]

The output will be this:

<a href="http://google.com" target="_blank" ><span style="font-family:Arial,Verdana;font-size:12px;font-weight:12px;color:#337D98;"><strong>My Anchor text</strong></span></a>

Related Posts:

  1. Where are Additional CSS files stored
  2. How to include own css on wordpress tinymce editor?
  3. How to customize the default HTML for WordPress Attachments
  4. Is it possible to change the attributes of a registered style or script before it fires?
  5. FireFox Inspector :: find CSS file related to
  6. Custom CSS for full post vs. excerpt (Content Options)
  7. How to get WordPress to accept the tag in articles (or other alternatives)
  8. How to remove padding and margin between divi rows? [closed]
  9. What will happen to the additional CSS when the theme is updated?
  10. How to display post title & excerpt when mouse hovers on an image?
  11. Include user defined styles without including wp-load
  12. Cannot figure out how to center div in WordPress theme [closed]
  13. Customizing default Mediaelement player
  14. how can I change the background color of all posts on my server?
  15. CSS to remove “comments count” icon from main page [closed]
  16. how to add custom css and js on wordpress post editor directly without using .php file
  17. TwentyFifteen: How can it show a different color on every post page?
  18. Adding code to child’s theme css and php cannot override certain elements
  19. Is it possible to add a ribbon in the background of h1 on every page?
  20. Resizing of a header/div in a website through css in wordpress [closed]
  21. Child Theme with multiple css files
  22. CSS Customizations for certain page
  23. Custom CSS at Appearance > Edit CSS is missing after update [closed]
  24. CSS Styling a specific page
  25. How to remove footer from just homepage
  26. Why the css in twenteenfourteen-child theme take no effect?
  27. How to format text of site subtitle
  28. how to add custom logo to my template
  29. WordPress noob, assign custom stylesheet using @import or if? Didn’t work for me
  30. str_replace inside specific css files [closed]
  31. Good way to customize admin CSS?
  32. css media query question [closed]
  33. How to customize the WordPress 2014 theme, to have page using less horizontal margin?
  34. Remove header title form page through CSS [closed]
  35. Centering one product on a single page [closed]
  36. Inline-Table under TwentyTwelve not working
  37. custom css and javascript not working on page defined as template?
  38. WordPress menu: How to make www.link.com/#name never contain current_page_item class?
  39. How to add Custom Css within the Editor?
  40. Will WordPress updates remove Gutenberg Additional Classes?
  41. Custom CSS Nav Menu Style Not Being Applied
  42. custom email validation using javascript api with elementor pro and code snippets
  43. Style WooCommerce Product Search Widget
  44. why won’t my custom css load with the enqueue method or any other method?
  45. Use Theme CSS in custom code
  46. How can I style the Comment Section of a blog post
  47. Hide entry-header for a specific category
  48. How do I make elements in mobile only reverse order?
  49. How to style bootstrap container in WordPress?
  50. how to add custom html and css to wordpress
  51. How can I delete the word `Category:` from page titles? [duplicate]
  52. How to have different background image based on post category
  53. How replace theme styles?
  54. Wrap WordPress Login Form in custom Div
  55. Customize WP website specific column with CSS
  56. How do I target this page specifically?
  57. How do I change the content of an element for a theme without losing the styling?
  58. I can’t override CSS
  59. Two color in one Heading
  60. Move text from the side of image to below image [closed]
  61. WordPress Inline Style missing
  62. Style Radio Buttons inside Edit Page (Custom Fields)
  63. Adding separate CSS files for separate pages with functions.php
  64. How to echo custom styles in css format?
  65. Background setting isn’t applied to entire sidebar height
  66. Special characters showing in fallback font
  67. How to support extra color options for shortcodes?
  68. Adding css and js to a blank page created with custom template
  69. Will too many overridden css rules lead to performance issues
  70. Complete Custom Style Part of Site
  71. add custom css on all page exept of one
  72. Making custom pages (with an example to explain the goal)
  73. Custom CSS File wont work on second Page
  74. how can i change the html and the css of my word press theme that I bought?
  75. responsive screen not working [closed]
  76. Edit image alignment in WordPress twentysixteen child theme on attachment page [closed]
  77. adding new html css to wordpress section from codepen [closed]
  78. use another theme for just one page
  79. Instead of Custom CSS Theme CSS is loading
  80. How do I add custom CSS animations for specific Gutenberg blocks?
  81. Particle.js not loading in WordPress Gutenberg
  82. Cannot add custom css in site
  83. Custom CSS working on home page but not on NEW created PAGE
  84. Post interior margin in twenty eleven theme
  85. Disable all Fonts that are Standard in WordPress and replacing them with a custom Font?
  86. Modifying posts based on category in TwentyTwentyTwo theme
  87. How to display product variations on same row
  88. Add custom styles to the Raft theme
  89. Where did I put this one line of css?
  90. Hover Hide-Visible Additional CSS not working in WordPress website, but shows properly in Customize window
  91. Newbie question – which css file to edit
  92. How to: Easily Move a WordPress Install from Development to Production?
  93. Is there a flowchart for WordPress loading sequence?
  94. Essential technical features for high-end WordPress web hosting? [closed]
  95. How to remove admin menu pages inserted by plugins?
  96. How to put logs in WordPress
  97. How to get the Date Format and Time Format settings for use in my template?
  98. Best Practices for Regression Testing WordPress Websites?
  99. Remove wrapping div and ul from output of wp_nav_menu
  100. What Is The Use Of map_meta_cap Filter?
Categories customization Tags css, customization, html-email
Wp-Admin extremely slow!
Add shortcode within the_content()

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress