{"id":3043,"date":"2019-05-31T13:15:45","date_gmt":"2019-05-31T17:15:45","guid":{"rendered":"https:\/\/med.virginia.edu\/web-support\/?page_id=3043"},"modified":"2025-03-13T16:24:45","modified_gmt":"2025-03-13T20:24:45","slug":"html_shortcodes","status":"publish","type":"page","link":"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/","title":{"rendered":"HTML &#038; Shortcodes"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-3061 alignright\" src=\"https:\/\/med.virginia.edu\/web-support\/wp-content\/uploads\/sites\/344\/2019\/05\/Coding1_325x488-300x200.jpg\" alt=\"\" width=\"300\" height=\"200\" srcset=\"https:\/\/med.virginia.edu\/web-support\/wp-content\/uploads\/sites\/344\/2019\/05\/Coding1_325x488-300x200.jpg 300w, https:\/\/med.virginia.edu\/web-support\/wp-content\/uploads\/sites\/344\/2019\/05\/Coding1_325x488.jpg 488w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/>Not everyone is a master coder, which is why we have created a page with the most common short codes and html codes that can help during the editing process.<\/p>\n<p>Think of these short codes as shortcuts\/hallways for web editors. To use these paths you must open the door with an open bracket<strong>\u00a0 [ <\/strong>and to complete the path you must close the door with a closed bracket <strong>] <\/strong>. Codes love good manners, so if you leave the door open, the code won&#8217;t work, so make sure to shut all your open doors at the end of your codes.<\/p>\n<hr \/>\n<h3>Most Common Shortcodes and Their Uses<\/h3>\n<p><em>NOTE: To prevent these shortcodes from actually showing news and events on the page here, we&#8217;ve added an extra space after the opening <strong>[<\/strong> bracket, and before the last ending <strong>]<\/strong> bracket. So, be sure to delete this extra space when using the code for your site.<\/em><\/p>\n<h4><strong>Homepage News Section<\/strong><\/h4>\n<p>Pulls in posts from your site\u2019s news section by category. Below is an example of the shortcode before adding your websites specifications. In the first &#8220;&#8221; block replace <strong>category name<\/strong>, with the\u00a0 name of the category you would like to select. Multiple categories can be added by inserting a <strong>comma<\/strong> in between the names. In the second &#8220;&#8221; block, input the number of articles that you&#8217;d like to be shown. You can choose a <strong>grid<\/strong> or a <strong>list<\/strong> view. As an example, here is the code that pulls in the news post on the <a href=\"https:\/\/med.virginia.edu\/web-support\/\">Web Support site&#8217;s homepage<\/a>:<\/p>\n<p class=\"p1\"><strong>[ uvasomposts cats=&#8221;migration-update, communications&#8221; num_items=&#8221;3&#8243; display=&#8221;grid&#8221; ]<\/strong><\/p>\n<h4><strong>Homepage Events Section<\/strong><\/h4>\n<p>Pulls in events from your site\u2019s calendar. The number in the first &#8220;&#8221; block is the number of items you would like to be shown. You can choose a <strong>grid<\/strong> or a <strong>list<\/strong> view. Here is an example of the code that pulls in the training events listed on the <a href=\"https:\/\/med.virginia.edu\/web-support\/\">Web Support site&#8217;s homepage<\/a>:<\/p>\n<p><strong>[ uvasomevents num_items=&#8221;6&#8243; display=&#8221;grid&#8221; ]<\/strong><\/p>\n<h4><strong>Homepage Health System Calendar Section<\/strong><\/h4>\n<p>Below is an example of the shortcode that pulls in events from the main <a href=\"https:\/\/www.healthsystem.virginia.edu\/calendar\/\">Health System Calendar<\/a> (example from the <a href=\"https:\/\/research.med.virginia.edu\/cic\/\">Carter Immunology Center<\/a>). To display your department\/division&#8217;s events, go to the <a href=\"https:\/\/www.healthsystem.virginia.edu\/calendar\/\">Health System Calendar<\/a>, and select &#8220;Generate RSS&#8221; from the upper right side of the page. Select your department, then &#8220;Generate RSS Link.&#8221; Copy this URL and replace the http info within the quotes &#8220;&#8221;.<\/p>\n<p><strong>[ uvasomrss url=&#8221;http:\/\/www.healthsystem.virginia.edu\/events\/index.cfm?viewtype=rss&amp;returnformat=hs&amp;filterdepartment=77&#8243; num_items=&#8221;6&#8243; display=&#8221;grid&#8221; type=&#8221;event&#8221; ]<\/strong><\/p>\n<p>For more information, see <a href=\"https:\/\/med.virginia.edu\/web-support\/training\/an-introduction-for-calendar-editors\/\">Introduction to the HS Calendar<\/a>.<\/p>\n<h4><strong>Video Frame Sizing<\/strong><\/h4>\n<p>In most cases, videos we add to our sites are from either YouTube or Vimeo. The video is added to a page by selecting &#8220;Add Media&#8221; and then &#8220;Insert from URL.&#8221;\u00a0The video is automatically sized to fit the width of the space available.<\/p>\n<p>In case where you would like the video to be <strong>smaller<\/strong>, use the code below. Adjust the width and height percentages to get the size you want:<\/p>\n<p><strong>[uvasom width=&#8221;50%&#8221; height=&#8221;25%&#8221; url=&#8221;YouTube\/Vimeo link&#8221; overflow=&#8221;hidden&#8221;]<\/strong><\/p>\n<hr \/>\n<h3>HTML Codes<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-3062 alignright\" src=\"https:\/\/med.virginia.edu\/web-support\/wp-content\/uploads\/sites\/344\/2019\/05\/Coding2_325x488-300x200.jpg\" alt=\"guy holding up sticky not that says code\" width=\"300\" height=\"200\" srcset=\"https:\/\/med.virginia.edu\/web-support\/wp-content\/uploads\/sites\/344\/2019\/05\/Coding2_325x488-300x200.jpg 300w, https:\/\/med.virginia.edu\/web-support\/wp-content\/uploads\/sites\/344\/2019\/05\/Coding2_325x488.jpg 488w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>When working in the WordPress visual page editor (the &#8220;Visual&#8221; tab), there are editing icons that enable you to bold and italicize text, create bulleted lists, add hyperlinks and the like. This is a quick way that WordPress injects HTML code into the page content behind the scenes (see &#8220;Text&#8221; tab).<\/p>\n<p>However, there are some cases\u2014like when creating captions for a <a href=\"https:\/\/med.virginia.edu\/web-support\/training\/faculty-listings-gallery-view\/\">Faculty\/Resident gallery view<\/a>\u2014where you will need to apply some basic HTML code to style the text:<\/p>\n<p class=\"p1\">\u00a0\u00a0*\u00a0\u00a0 <b>Bold<\/b>:\u00a0 &lt;strong&gt;word&lt;\/strong&gt;<\/p>\n<p class=\"p1\">\u00a0\u00a0*\u00a0 \u00a0<strong>Line Break<\/strong>:\u00a0 &lt;br\/&gt; (creates lines of spacing in between lines of text)<\/p>\n<p class=\"p1\">\u00a0\u00a0*\u00a0 \u00a0<strong>Hyperlink<\/strong>:\u00a0 &lt;a href=&#8221;websiteURL&#8221;&gt;words&lt;\/a&gt;<\/p>\n<p class=\"p1\">\u00a0\u00a0*\u00a0\u00a0<strong> Italics<\/strong><i>:\u00a0 <\/i>&lt;em&gt;word&lt;\/em&gt;<\/p>\n<p class=\"p1\">\u00a0\u00a0*\u00a0 <strong>\u00a0Underline<\/strong>:\u00a0 &lt;span style=&#8221;text-decoration: underline;&#8221;&gt; word&lt;\/span&gt;<\/p>\n<p class=\"p1\">\n","protected":false},"excerpt":{"rendered":"<p>Not everyone is a master coder, which is why we have created a page with the most common short codes and html codes that can help during the editing process. Think of these short codes as shortcuts\/hallways for web editors. To use these paths you must open the door with an open bracket\u00a0 [ and [&hellip;]<\/p>\n","protected":false},"author":1462,"featured_media":0,"parent":3183,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":"","_links_to":"","_links_to_target":""},"tags":[],"class_list":["post-3043","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.1.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>HTML &amp; Shortcodes - SOM Web Support<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HTML &amp; Shortcodes - SOM Web Support\" \/>\n<meta property=\"og:description\" content=\"Not everyone is a master coder, which is why we have created a page with the most common short codes and html codes that can help during the editing process. Think of these short codes as shortcuts\/hallways for web editors. To use these paths you must open the door with an open bracket\u00a0 [ and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/\" \/>\n<meta property=\"og:site_name\" content=\"SOM Web Support\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-13T20:24:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/med.virginia.edu\/web-support\/wp-content\/uploads\/sites\/344\/2019\/05\/Coding1_325x488.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"488\" \/>\n\t<meta property=\"og:image:height\" content=\"325\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/\",\"url\":\"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/\",\"name\":\"HTML & Shortcodes - SOM Web Support\",\"isPartOf\":{\"@id\":\"https:\/\/med.virginia.edu\/web-support\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/med.virginia.edu\/web-support\/wp-content\/uploads\/sites\/344\/2019\/05\/Coding1_325x488-300x200.jpg\",\"datePublished\":\"2019-05-31T17:15:45+00:00\",\"dateModified\":\"2025-03-13T20:24:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/#primaryimage\",\"url\":\"https:\/\/med.virginia.edu\/web-support\/wp-content\/uploads\/sites\/344\/2019\/05\/Coding1_325x488.jpg\",\"contentUrl\":\"https:\/\/med.virginia.edu\/web-support\/wp-content\/uploads\/sites\/344\/2019\/05\/Coding1_325x488.jpg\",\"width\":488,\"height\":325,\"caption\":\"woman showing man how to fix code on his computer\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/med.virginia.edu\/web-support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WordPress &#038; Web Resources\",\"item\":\"https:\/\/med.virginia.edu\/web-support\/webresources\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"HTML &#038; Shortcodes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/med.virginia.edu\/web-support\/#website\",\"url\":\"https:\/\/med.virginia.edu\/web-support\/\",\"name\":\"SOM Web Support\",\"description\":\"University of Virginia School of Medicine\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/med.virginia.edu\/web-support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HTML & Shortcodes - SOM Web Support","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"HTML & Shortcodes - SOM Web Support","og_description":"Not everyone is a master coder, which is why we have created a page with the most common short codes and html codes that can help during the editing process. Think of these short codes as shortcuts\/hallways for web editors. To use these paths you must open the door with an open bracket\u00a0 [ and [&hellip;]","og_url":"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/","og_site_name":"SOM Web Support","article_modified_time":"2025-03-13T20:24:45+00:00","og_image":[{"width":488,"height":325,"url":"https:\/\/med.virginia.edu\/web-support\/wp-content\/uploads\/sites\/344\/2019\/05\/Coding1_325x488.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/","url":"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/","name":"HTML & Shortcodes - SOM Web Support","isPartOf":{"@id":"https:\/\/med.virginia.edu\/web-support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/#primaryimage"},"image":{"@id":"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/#primaryimage"},"thumbnailUrl":"https:\/\/med.virginia.edu\/web-support\/wp-content\/uploads\/sites\/344\/2019\/05\/Coding1_325x488-300x200.jpg","datePublished":"2019-05-31T17:15:45+00:00","dateModified":"2025-03-13T20:24:45+00:00","breadcrumb":{"@id":"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/#primaryimage","url":"https:\/\/med.virginia.edu\/web-support\/wp-content\/uploads\/sites\/344\/2019\/05\/Coding1_325x488.jpg","contentUrl":"https:\/\/med.virginia.edu\/web-support\/wp-content\/uploads\/sites\/344\/2019\/05\/Coding1_325x488.jpg","width":488,"height":325,"caption":"woman showing man how to fix code on his computer"},{"@type":"BreadcrumbList","@id":"https:\/\/med.virginia.edu\/web-support\/webresources\/html_shortcodes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/med.virginia.edu\/web-support\/"},{"@type":"ListItem","position":2,"name":"WordPress &#038; Web Resources","item":"https:\/\/med.virginia.edu\/web-support\/webresources\/"},{"@type":"ListItem","position":3,"name":"HTML &#038; Shortcodes"}]},{"@type":"WebSite","@id":"https:\/\/med.virginia.edu\/web-support\/#website","url":"https:\/\/med.virginia.edu\/web-support\/","name":"SOM Web Support","description":"University of Virginia School of Medicine","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/med.virginia.edu\/web-support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/med.virginia.edu\/web-support\/wp-json\/wp\/v2\/pages\/3043","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/med.virginia.edu\/web-support\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/med.virginia.edu\/web-support\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/med.virginia.edu\/web-support\/wp-json\/wp\/v2\/users\/1462"}],"replies":[{"embeddable":true,"href":"https:\/\/med.virginia.edu\/web-support\/wp-json\/wp\/v2\/comments?post=3043"}],"version-history":[{"count":7,"href":"https:\/\/med.virginia.edu\/web-support\/wp-json\/wp\/v2\/pages\/3043\/revisions"}],"predecessor-version":[{"id":4700,"href":"https:\/\/med.virginia.edu\/web-support\/wp-json\/wp\/v2\/pages\/3043\/revisions\/4700"}],"up":[{"embeddable":true,"href":"https:\/\/med.virginia.edu\/web-support\/wp-json\/wp\/v2\/pages\/3183"}],"wp:attachment":[{"href":"https:\/\/med.virginia.edu\/web-support\/wp-json\/wp\/v2\/media?parent=3043"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/med.virginia.edu\/web-support\/wp-json\/wp\/v2\/tags?post=3043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}