{"id":2003,"date":"2024-02-23T09:26:12","date_gmt":"2024-02-23T17:26:12","guid":{"rendered":"https:\/\/www.hmc.edu\/communications\/?page_id=2003"},"modified":"2025-11-20T08:33:53","modified_gmt":"2025-11-20T16:33:53","slug":"buttons","status":"publish","type":"page","link":"https:\/\/www.hmc.edu\/communications\/wordpress-how-tos\/buttons\/","title":{"rendered":"WordPress: Buttons"},"content":{"rendered":"\n<p>The Button is a custom block developed by the Office of Communications and Marketing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Purpose<\/h2>\n\n\n\n<p>The button is ideal to for a call to action or other task you&#8217;d like to encourage the users to undertake.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Availability<\/h2>\n\n\n\n<p>This block is only available on the Primary Page and Default page templates.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Elements of the Block<\/h2>\n\n\n\n<p>The button has the following user-defined elements:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>visible text<\/li>\n\n\n\n<li>destination URL\n<ul class=\"wp-block-list\">\n<li>option to open a YouTube link in a pop up modal<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>ARIA label<br><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Adding a Button Block<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>With your cursor in the editor in the desired block position, type\u00a0<kbd>\/<\/kbd>\u00a0to open the block selector<\/li>\n\n\n\n<li>Start typing the word \u201cbutton\u201d and after a few characters the chooser will filter the other blocks, leaving the Button as the only option; select it.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Configuring the Button Block<\/h2>\n\n\n\n<p>The Button is configured in the right settings sidebar. It&#8217;s important that buttons are configured correctly to ensure accessibility requirements are met.<\/p>\n\n\n\n<p>This is especially important if there is more than one button on a page with similar visible text. <\/p>\n\n\n\n<p>There are five customizable parts of the button. Refer to the image and the sections below for explanations. To configure a button, ensure that the button itself is selected in the editor and the the settings sidebar is open. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full border\"><img loading=\"lazy\" decoding=\"async\" width=\"2038\" height=\"1390\" src=\"https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/button-config.png\" alt=\"\" class=\"wp-image-2564\" srcset=\"https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/button-config.png 2038w, https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/button-config-300x205.png 300w, https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/button-config-1024x698.png 1024w, https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/button-config-768x524.png 768w, https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/button-config-1536x1048.png 1536w\" sizes=\"auto, (max-width: 2038px) 100vw, 2038px\" \/><figcaption class=\"wp-element-caption\">Button configuration settings take place in the right settings sidebar<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">1. Style<\/h3>\n\n\n\n<p>By default, if you add multiple buttons next to each other, they will appear in a stacked layout.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full border\"><img loading=\"lazy\" decoding=\"async\" width=\"1486\" height=\"256\" src=\"https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/buttons-stacked.png\" alt=\"\" class=\"wp-image-2565\" srcset=\"https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/buttons-stacked.png 1486w, https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/buttons-stacked-300x52.png 300w, https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/buttons-stacked-1024x176.png 1024w, https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/buttons-stacked-768x132.png 768w\" sizes=\"auto, (max-width: 1486px) 100vw, 1486px\" \/><figcaption class=\"wp-element-caption\">Two buttons stacked, as is the default<\/figcaption><\/figure>\n\n\n\n<p>If you wish them to in inline, select the <kbd>In row<\/kbd> styles button. Note: all buttons must have <kbd>In row<\/kbd> selected for them to appear inline. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full border\"><img loading=\"lazy\" decoding=\"async\" width=\"1490\" height=\"150\" src=\"https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/buttons-inlne.png\" alt=\"\" class=\"wp-image-2566\" srcset=\"https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/buttons-inlne.png 1490w, https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/buttons-inlne-300x30.png 300w, https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/buttons-inlne-1024x103.png 1024w, https:\/\/www.hmc.edu\/communications\/wp-content\/uploads\/sites\/19\/2025\/11\/buttons-inlne-768x77.png 768w\" sizes=\"auto, (max-width: 1490px) 100vw, 1490px\" \/><figcaption class=\"wp-element-caption\">Buttons configured to be in a row<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">2. Button Text<\/h3>\n\n\n\n<p>Keep text short and descriptive of the action.  e.g.:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Read more<\/li>\n\n\n\n<li>Learn more<\/li>\n\n\n\n<li>Register<\/li>\n\n\n\n<li>Book<\/li>\n<\/ul>\n\n\n\n<p class=\"mudd-highlighted-content\">These examples appear to contradict the requirement that links (which is what these buttons actually are) make sense out of context by uniquely describing what is at the destination. Please make sure you complete the ARIA label field correctly (see below).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Button Destination<\/h3>\n\n\n\n<p>The URL of where the users will be taken if the button is clicked.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. YouTube Popup (optional)<\/h3>\n\n\n\n<p>If you enter in the destination field a URL to a YouTube video, another option appears that allows you to set whether the video will open in a popup window. Leave this set to off if wish the link to take the user to the YouTube website. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. Button ARIA Label<\/h3>\n\n\n\n<p>As text such as &#8220;Read more&#8221; or &#8220;Book&#8221; can be vague, it is important to configure the ARIA label to give further context. <\/p>\n\n\n\n<p>Ensure that the ARIA label begins with the button text.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Examples<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A button with visible text of &#8220;Read More&#8221; may have an ARIA label of &#8220;Read more about John Doe&#8221;<\/li>\n\n\n\n<li>A button with visible text of &#8220;Book&#8221; may have an ARIA label of &#8220;Book a room at the Claremont Double Tree&#8221;<\/li>\n\n\n\n<li>A button with visible text of &#8220;Register&#8221; may have an ARIA label of &#8220;Register for the San Francisco alumni event&#8221;<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The Button is a custom block developed by the Office of Communications and Marketing. Purpose The button is ideal to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":995,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-2003","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.hmc.edu\/communications\/wp-json\/wp\/v2\/pages\/2003","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hmc.edu\/communications\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.hmc.edu\/communications\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.hmc.edu\/communications\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hmc.edu\/communications\/wp-json\/wp\/v2\/comments?post=2003"}],"version-history":[{"count":5,"href":"https:\/\/www.hmc.edu\/communications\/wp-json\/wp\/v2\/pages\/2003\/revisions"}],"predecessor-version":[{"id":2567,"href":"https:\/\/www.hmc.edu\/communications\/wp-json\/wp\/v2\/pages\/2003\/revisions\/2567"}],"up":[{"embeddable":true,"href":"https:\/\/www.hmc.edu\/communications\/wp-json\/wp\/v2\/pages\/995"}],"wp:attachment":[{"href":"https:\/\/www.hmc.edu\/communications\/wp-json\/wp\/v2\/media?parent=2003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}