• Certain parts of the content on my homepage take up rather long parts in the HTML code, and I would therefore like to define them in one central place and then call them by referring to this macro – which we could maybe call a text macro.

    It is probably most easily explained by two examples:

    1) To write LaTeX the way it’s supposed to be typeset, I use the following HTML code:

    <span class="texhtml" style="font-family: 'CMU Serif', cmr10, LMRoman10-Regular, 'Times New Roman', 'Nimbus Roman No9 L', Times, serif;">L<span style="text-transform: uppercase; font-size: 70%; margin-left: -0.36em; vertical-align: 0.3em; line-height: 0; margin-right: -0.15em;">a</span>T<span style="text-transform: uppercase; margin-left: -0.1667em; vertical-align: -0.5ex; line-height: 0; margin-right: -0.125em;">e</span>X</span>;

    This is rather long, and I would like to define this in just one place, and then be able to use it, both in pages and posts on my site.

    2) When making a quote I used the following:

    <span style="padding-left: 20px; padding-right: 40px; display:block"><font size="2"><i>&ldquo;This is where the quote goes&rdquo;</i></font></span><p>

    Likewise, I would like to define this quoting environment in one place, and then be able to use it everywhere on my page.

    Is this possible? And if yes, where in my theme (child theme of the TwentyTwelve) should I define these?

    Thanks in advance for any help!

Viewing 1 replies (of 1 total)
  • One idea that I can think of is that you could create a shortcode for the first example.

    For the second though, I would just edit the CSS and make the blockquote display the quote as you want. You should keep presentation apart from the content and shouldn’t be using font tags and inline css.

Viewing 1 replies (of 1 total)
  • The topic ‘How to define a text macro?’ is closed to new replies.