html coding tumblr tutorials and guides

Author

Posted Nov 16, 2024

Reads 728

Focused shot of HTML and CSS code on a monitor for web development.
Credit: pexels.com, Focused shot of HTML and CSS code on a monitor for web development.

If you're new to HTML coding, Tumblr is a great platform to learn on. Tumblr's custom HTML theme editor allows you to add custom HTML, CSS, and JavaScript to your blog's theme.

One of the best features of Tumblr's custom HTML theme editor is that it's very user-friendly. You can add custom HTML code to your blog's theme with just a few clicks.

Tumblr's custom HTML theme editor also allows you to use custom CSS to style your blog's theme. You can add custom CSS code to your blog's theme with the same ease as adding custom HTML code.

If you're looking to learn HTML coding, Tumblr's custom HTML theme editor is a great place to start.

If this caught your attention, see: How to Add Css Stylesheet to Html

Variables and Data Types

Variables and Data Types are crucial in HTML coding on Tumblr. You can use them to display dynamic content on your blog.

The HTML-safe title of your blog can be accessed using the {Title} variable. This is useful for displaying your blog's title in the page title, especially when combined with the {block:PostTitle} variable, which renders the current post's title on permalink pages.

Credit: youtube.com, Coding Basics: Variables | Programming for Beginners |

You can also use variables to display your blog's description, which can include HTML, using the {Description} variable. Additionally, the {MetaDescription} variable provides an HTML-safe description of your blog, which can be useful for search engine optimization (SEO).

Here are some key variables you should know about:

These variables can be used to customize your blog's appearance and display dynamic content to your readers.

Basic Variables

Variables in blogging are essential for customizing your content. They allow you to use dynamic information, such as your blog's title, URL, and description, in various parts of your blog.

The HTML-safe title of your blog is represented by the variable {Title}. This variable can be used in your blog's HTML code to display your title.

Your blog's main URL is stored in the variable {BlogURL}. This variable is useful for linking to your blog from other websites.

A description of your blog, which can include HTML code, is stored in the variable {Description}. This variable can be used to provide a brief summary of your blog's content.

Credit: youtube.com, Python variables for beginners ❎

Your blog's HTML-safe description is stored in the variable {MetaDescription}. This variable is used in the meta description tag of your blog's HTML code.

The variable {RSS} stores the URL of your blog's RSS feed. This variable is useful for readers who want to subscribe to your blog's feed.

The variable {Favicon} stores the URL of your blog's favicon. A favicon is a small icon that appears in the address bar of a web browser.

Here's a list of some common variables used in blogging:

The variable {CustomCSS} stores any custom CSS code that you've added on your blog's Customize page. This variable can be used to add custom styles to your blog.

The variable {CopyrightYears} displays the span of years your blog has existed. This variable can be used to add a copyright notice to your blog.

Expand your knowledge: Webflow Custom Code

Booleans

Booleans are special data types that can have one of two values: true or false. This is useful for making decisions in your code.

Credit: youtube.com, Boolean datatype - DART variable types - Dart Course # 6

By including special meta-if tags in your theme, users can easily toggle options you define, such as showing or hiding different widgets or design elements. This is a great way to make your code more interactive and user-friendly.

Booleans are often used in conditional statements, which allow your code to make decisions based on the value of a Boolean variable. For example, you can use a Boolean variable to show or hide a widget based on a user's preferences.

Meta-if tags are a powerful tool for working with Booleans, allowing you to easily create interactive and dynamic code. By using these tags, you can create a more engaging and user-friendly experience for your users.

Tags

Tags are a crucial part of Tumblr customization, and understanding how they work can greatly enhance your blog's appearance and functionality.

The {block:Tags} variable is used to render tags for each post, while the {block:HasTags} variable is used to check if a post has any tags. This is especially useful when creating custom layouts or designs for your blog.

Additional reading: Coding Tags for Html

Credit: youtube.com, PHP variables and data types

If a post has tags, the {block:Tags} variable will render a list of those tags. Each tag is represented by the {Tag} variable, which displays the name of the tag. You can also use the {URLSafeTag} variable to get a URL-safe version of the tag name.

Here's a breakdown of the variables related to tags:

By understanding how tags work and using the right variables, you can create a more engaging and interactive experience for your readers.

Variable Transformations

Variable Transformations are a powerful tool in Tumblr's theme variables, allowing you to manipulate the output of variables to suit your needs.

There are five transformations available: Plaintext, Javascript, Javascript Plaintext, URLEncoded, and RGB.

Prefixing a variable with Plaintext will output the string with HTML-tags stripped and appropriate characters converted to HTML-entities.

This is useful when passing data to Javascript, as it ensures the data is safe to include in HTML attributes.

Readers also liked: Data Text Html

Credit: youtube.com, Data Types, Variables & Constants

Prefixing a variable with Javascript will output a Javascript string wrapped in quotes.

This is perfect for embedding dynamic data into your theme's Javascript code.

Prefixing a variable with Javascript Plaintext will output a Javascript string wrapped in quotes, with HTML-tags stripped and appropriate characters converted to HTML-entities.

This is similar to Plaintext, but specifically designed for use in Javascript code.

Prefixing a variable with URLEncoded will output a URL encoded string.

This is useful when passing data to URLs or other external resources.

Prefixing a color variable with RGB will convert the hex output to RGB.

This is a convenient way to work with colors in your theme.

Or Markdown

You can switch to HTML or Markdown mode in the post editor if you'd like.

The post editor uses rich text editing by default, but you can switch to HTML or Markdown mode if you’d like.

Any advanced custom HTML aside from styling options already included in the post editor will be removed when saving your post.

Click the little question mark to see how many minutes of video you have left today before hitting the limit.

Content Sources

Credit: youtube.com, Variables & Data Types | Javascript | Tutorial 6

Content Sources are an essential part of working with variables and data types.

If a source is specified for a post's content, the {block:ContentSource} tag is rendered. This allows you to add a source to your content.

The {SourceURL} tag displays the URL of the attributed source, making it easy to link back to the original content.

A source logo can also be displayed using the {block:SourceLogo} tag. If a logo exists, it will be rendered.

The {BlackLogoURL} tag shows the URL of the source's logo, which can be useful for customizing the appearance of your content.

The {LogoWidth} and {LogoHeight} tags display the width and height of the source's logo, respectively.

The {SourceTitle} tag shows the title of the content source, providing context for your readers.

Finally, the {block:NoSourceLogo} tag is rendered if no source logo exists, which can be useful for displaying a default image or message.

Submissions

Submissions are a special case when it comes to variables. They have their own set of variables that are rendered differently than others.

Credit: youtube.com, #6 JavaScript Tutorial | Variables & Data Types

A post is considered a submission if it has the {block:Submission} tag. This tag is rendered if the post meets the submission criteria.

The submitter's name is displayed using the {Submitter} variable. This variable shows the name of the blog that submitted the post.

You can also link to the submitter's blog using the {SubmitterURL} variable. This variable contains the URL of the submitter's blog.

The submitter's portrait photo is displayed in different sizes using various variables. The sizes range from 16x16 pixels to 128x128 pixels.

Here are the portrait photo variables with their corresponding sizes:

Likes

Likes are a great way to share your favorite content with others. You can render a block of likes using the {block:Likes} {/block:Likes} variable.

There are several ways to display likes on your blog, including using the {Likes} variable, which outputs standard HTML. You can also use {Likes limit="5"} to show your last 5 likes, with a maximum of 10 likes displayed.

Credit: youtube.com, Always Be Coding [5] - Data Types and Variables (Review)

If you want to scale the audio and video players in your likes to a specific width, you can use the {Likes width="200"} variable. This will scale the players to 200 pixels wide, while you can use CSS to scale images with a max-width.

For text-heavy likes, you can use the {Likes summarize="100"} variable to summarize the text to 100 characters, with a maximum of 250 characters displayed.

Here are some examples of likes variables:

Appearance and Design

You can customize your Tumblr blog's appearance and design with ease using HTML coding. By including special meta-color tags, users can tweak colors using the Customize page. You can also specify default colors to inherit values from the global appearance parameters.

To change the font, you can include special meta-font tags in your theme, allowing users to easily switch fonts using the Customize page. You can also specify a default font to inherit the value from the "Title font" global appearance parameter.

For more insights, see: Edit Font Html

Credit: youtube.com, Creating a Tumblr Theme Base

Custom CSS can be enabled by including the {CustomCSS} tag at the bottom of your theme's CSS style block, allowing users to tweak the appearance without editing the markup. With CSS, you can style your Tumblr theme with precision and control, modifying font styles, colors, background images, and adding animations to make your blog unique.

Readers also liked: Html Css Grid

Custom Text

Custom Text is a powerful feature that allows users to configure text variables you define. This is especially useful for adjusting text or configuring widgets that require information from the user.

By including special meta-text tags in your theme, users can easily customize the text variables you've defined. This is a great way to make your design more user-friendly and flexible.

Including meta-text tags in your theme enables users to configure text variables, which can be used to adjust text or configure widgets.

Custom Images

Custom images can be easily used without editing the theme by including special meta-image tags.

Image variables like {image:Logo} will return a 1-pixel transparent square if no image is set.

You can specify {HeaderImage} as the default to inherit the value from the "Header image" global appearance parameter.

This allows users to upload a different image and it will automatically update the header image.

If this caught your attention, see: Html Coding Background Image

Global Appearance

Credit: youtube.com, 4- How to Set Up the Frontend Dashboard's Global Appearance

Global Appearance is where you define the overall look and feel of your Tumblr blog. You can customize colors, fonts, and other options to make your blog stand out.

The font used for your blog title is defined by the {TitleFont} variable, which can be changed using the Customize page. You can also specify {TitleFont} as the default to inherit the value from the "Title font" global appearance parameter.

Customizing colors is also a breeze. You can define custom colors using special meta-color tags, such as {BackgroundColor}, {TitleColor}, and {AccentColor}. These colors can be tweaked using the Customize page.

Here's a list of some key variables that define your global appearance:

You can also control the display of certain elements using block variables, such as {block:ShowTitle} and {block:HideTitle}. These variables render the corresponding element based on the user's settings.

Featured tags can add a touch of personality to your blog's appearance, and with the right variables, you can showcase them in a visually appealing way. The first step is to check if your blog has any featured tags, which can be done using the {block:HasFeaturedTags} variable.

Credit: youtube.com, Tags, Creative Ways To Use Them / Creative Design Team

This variable will render if your blog has any featured tags, giving you a clear indication of what to work with. Once you've confirmed that you have featured tags, you can use the {block:FeaturedTags} variable to render each of them.

The {Tag} variable can be used to display the name of each featured tag, while the {URLSafeTag} variable can be used to create a URL-safe version of the tag. If you want to link to a page featuring other posts with the same tag, you can use the {TagURL} variable.

Here's a breakdown of the variables you can use to showcase your featured tags:

By using these variables, you can create a visually appealing and informative feature that highlights your blog's featured tags and encourages readers to explore more content related to each tag.

Like Button

The Like Button is a versatile feature that allows visitors to show their appreciation for your content. It's a simple yet effective way to engage with your audience.

Credit: youtube.com, Figma Animation | Heart Animation | Like Button ❤️

You can customize the Like Button to fit your design by using different colors. For example, you can choose from Grey, White, or Black.

The Like Button will always display in red when a visitor has already liked the post. This is a nice touch that helps visitors keep track of their interactions.

You can also adjust the size of the Like Button to suit your layout. The maximum size is 100 pixels.

Here's a summary of the Like Button options:

Reblog Button

The Reblog Button is a crucial element in your Tumblr theme's appearance. You can customize it to fit your design.

You can use the {ReblogButton} variable to display a default Reblog button. If you want to customize its appearance, you can use the {ReblogButton color="grey"} or {ReblogButton color="white"} or {ReblogButton color="black"} variables to change its color.

You can also adjust the size of the Reblog button using the {ReblogButton size="20"} variable, with a maximum size of 100.

If your theme uses infinite scrolling or AJAX pagination, you'll need to request the like status of the new posts once the page is loaded or inserted.

You might like: Text Size Html Code

Frequently Asked Questions

How do you put HTML code on Tumblr?

To add HTML code on Tumblr, go to Settings, select your blog, and toggle on Custom Theme, then click Edit Theme to access the HTML editor. From there, you can edit the custom HTML as desired in the source code editor.

What coding language is Tumblr?

Tumblr uses a combination of HTML and CSS, making it accessible to developers who understand these two languages. Learn how to harness their power to create a custom Tumblr theme.

Claire Beier

Senior Writer

Claire Beier is a seasoned writer with a passion for creating informative and engaging content. With a keen eye for detail and a talent for simplifying complex concepts, Claire has established herself as a go-to expert in the field of web development. Her articles on HTML elements have been widely praised for their clarity and accessibility.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.