Nola txertatu kodea WordPress-eko post-etan

Gure postetan kodea txertatzeko bi pausu jarraitu behar dira:

Kodea txertatu “code” etiketarekin eta plugina instalatu efektu ikusgarriagoa lortzeko.

1.- Txertatu kodea etiketekin.

How-to-insert-code-in-a-WordPress

 

 

 

 

 

2.- Plugin-a deskargatu eta aktibatu. Kasu hoonetan SyntaxHighlighter Evolved plugin-a erabili dut.

Emaitza:

#button {
    font-weight: bold;
    border: 2px solid #fff;
}

 

Konfiguratu daitezkeen ezaugarri asko dago emaitza oberenak lortzeko. Ondorengo adibidean (language=”html” firstline=”33″) txertatu dut kodea 33. lerrotik hasteko.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>WordPress.com Code Example</title>
</head>
<body>
    <h1>WordPress.com Code Example</h1>

    <p><?php echo 'Hello World!'; ?></p>

    <p>This line is highlighted.</p>

    <p>This line is very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long.</p>

    <div class="foobar">
        This    is  an
        example of  smart
        tabs.
    </div>

    <p><a href="http://wordpress.com/">WordPress.com</a></p>
</body>
</html>

Informazio gehiago lortzeko: Code ┬╗Posting Source Code.