A site map is its contents or table of contents, just like in an ordinary book. This is a convenient way to instantly go to any page or publication on the site. Let's consider two options for creating a sitemap: using a plugin and without.

1. Create a sitemap using a plugin

There are many different plugins to solve this problem, each of which has its own characteristics, but I chose . But in this article I want to write about the well-proven Dagon Design Sitemap Generator plugin. Despite the fact that its last version was released back in 2009, it still has not lost its relevance.

Here's what the plugin developers' sitemap looks like: Installing the Dagon Design Sitemap Generator plugin:
  • Go to the developer’s website and download latest version plugin.
  • Unzip the archive and upload its contents to the /wp-content/plugins/ folder.
  • Let's activate the plugin.
  • On the left, in the administrative panel in the “Settings” section, the DDSitemapGen menu will appear.
  • Let's move on to setting up the plugin

    In Language, select the Russian language, save and update the page. Now that the settings are in Russian, in principle, everything has become clear. You can customize the display of articles and/or pages, sorting entries by date or title. It is possible to exclude certain categories and pages.

    First, let's create a sitemap, and then you can customize it to your liking. This is done very simply.

    Creating a sitemap:
  • We create a separate page to display the content of our site,
  • We name the page: Site map, Site content, All articles, etc.
  • Switch to HTML mode and add the following code
  • Publish the page and enjoy the result! Or go back to the settings and adjust them as you wish.

    2. Create a sitemap without using a plugin​

    Please note that each additional plugin makes pages take longer to load, so now we will try to create a table of contents for our site without using plugins.
    If you have already created a sitemap using a plugin, then disable it in the admin panel.

    This folder contains various files such as header.php, footer.php, style.css and others. Now in the same folder we need to create our own file and name it, for example sitemap.php.
    This will be our sitemap file. Open the file and paste the following php code into it:


    Pages







    Archives





    Articles by category


    • But before you insert the script, you must edit it to suit yourself.

      1. Enter the length of the commentator's name. Put “0” and then the commentator’s name will not be truncated at all; if you want the name to be no more than 10 characters, then put 10.
      2. Update. We set it to “true”, that is, monthly.
      3. Number of reviews: “true” - show, “false” - do not show.
      4. Enclose links in noffolow: “true” - yes, “false” - no.
      5. Display the number of commentators.
      6. How many columns.
      7. Avatar size.
      8. Here you must write down all the email addresses that you use when commenting on yours, that is, when responding to reader comments.

      function sp_top_commentator())( global $wpdb; $length = 10; // number of characters $month = false; // update frequency $comment = true; // comment rate $nofollow = true; // comment indexing $count = 6; // number of commentators $col = 3; // number of columns $avatarSize = 65; // avatar size $exceptionEmail = " [email protected], [email protected]"; // address exclusion $results = $wpdb->get_results(" SELECT COUNT(comment_author_email) AS comments_count, comment_author_email, comment_author, comment_author_url FROM (select * from ".$wpdb->comments." order by comment_ID desc) as pc WHERE comment_author_email != "" AND comment_type = "" AND comment_approved = 1 AND comment_author_email NOT IN (".preg_replace("/([\w\d\.\-_]+@[\w\d\.\-_ ]+)(,? ?)/",""\\1"\\2",$exceptionEmail).")". ($month ? "AND month(comment_date) = month(now()) AND year( comment_date) = year(now())" : ""). "GROUP BY comment_author_email ORDER BY comments_count DESC LIMIT ".$count); $output = " "; $i = 0; foreach($results as $result)( if ($i>=$col) ( $output .= ""; $i = 0; ) $i++; $output .= " "; ) if ($i "; $output .= "

      ".get_avatar($result->comment_author_email,$avatarSize)."

      "; if ($length and $length comment_author)) $result->comment_author = trim(mb_substr($result->comment_author, 0, $length))."; if ($result->comment_author_url) if ($ nofollow) $output .= "comment_author_url."">".$result->comment_author." "; else $output .= "comment_author_url." ">".$result->comment_author." "; else $output .= $result->comment_author; if ($comment) $output .= "(".$result->comments_count.")"; $output .= "

      "; echo $output; )

      The code has been inserted. Go to the file style.css (style sheet). It is located in the same place as functions.php, so you don’t need to look for anything. At the end, after all the prescribed styles, insert another script and do not forget to refresh the page:

      Top-comment ( height:100%; margin-top:-10px; ) .top-comment table ( min-height: 100%; height:100%; margin: 20px 0px 0px 5px; ) .top-comment table td ( float: center; padding: 9px; width: 70px; .top-comment .avatar-top img ( border: 3px solid #7FB2EC; ) .top-comment .avatar-comment ( font-size: 11px; margin: 0 )

      Well then. Now all that remains is to add this short script to sidebar.php, or to appearance => widgets. Move the TEXT folder to the right side, open it and paste the code.

      We save, update and the TOP commentators should be displayed. On this note, I end this post. I hope that now it won’t be difficult for you to create a widget of top commentators on your blog. Happy installation. See you.

      At the end of the article there is a video about the correct installation of TOP commentators on a WordPress blog:

      Best regards, Yuri Zhuk.

      Hello, dear friends. I won't talk about what CNC is. If you are reading this, you probably already know. Not long ago I was looking at search engine results for the query: CNC setup in WordPress and literally under every link there was the same thing. Everyone, without exception, recommended installing the RusToLat plugin first. And that’s right, the first thing you need to do is transliterate, that is, convert Russian characters into Latin ones. I also wrote about this in an article about. But I recently came to the conclusion that I can abandon this plugin. Not quite of course. Although the plugin itself has only one file, it still creates an item in the administrative part. But it is simply not needed there, since there is nothing to configure there.

      That's why CNC setup in WordPress can be done without a plugin by simply inserting the code into the functions.php file. This piece of code needs to be inserted into the file. Can I insert it at the very end, before the closing one?>.

      1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 //rus-to-lat $gost = array ( "Є" => "EH" , "І" => "I" , "і" => "i" , "№" => "#" , "є " => "eh" , "A" => "A" , "B" => "B" , "C" => "V" , "G" => "G" , "D" => "D " , "E" => "E" , "Ё" => "JO" , "ZH" => "ZH" , "Z" => "Z" , "I" => "I" , "Y" => "JJ" , "K" => "K" , "L" => "L" , "M" => "M" , "N" => "N" , "O" => "O" , "P" => "P" , "P" => "R" , "C" => "S" , "T" => "T" , "U" => "U" , "F" = > "F" , "Х" => "KH" , "Ц" => "C" , "Ч" => "CH" , "Ш" => "SH" , "Ш" => "SHH" , "Ъ" => """ , "ы" => "Y" , "b" => "" , "Э" => "EH" , "У" => "YU" , "Я" => " YA" , "a" => "a" , "b" => "b" , "c" => "v" , "g" => "g" , "d" => "d" , "e " => "e" , "ё" => "jo" , "zh" => "zh" , "z" => "z" , "i" => "i" , "th" => "jj " , "k" => "k" , "l" => "l" , "m" => "m" , "n" => "n" , "o" => "o" , "p" => "p" , "p" => "r" , "s" => "s" , "t" => "t" , "y" => "u" , "f" => "f" , "x" => "kh" , "ts" => "c" , "ch" => "ch" , "sh" => "sh" , "ш" => "shh" , "ъ" = > "" , "ы" => "y" , "ь" => "" , "е" => "eh" , "yu" => "yu" , "я" => "ya" , "« " => "" , """ => "" , "-" => "-" ) ; $iso = array ( "Є" => "YE" , "І" => "I" , "Ѓ" => "G" , "і" => "i" , "№" => "#" , "є" => "ye" , "ѓ" => "g" , "A" => "A" , "B" => "B" , "В" => "V" , "Г" => "G", "D" => "D", "E" => "E", "Ё" => "YO", "ZH" => "ZH", "Z" => "Z", " I" => "I", "Y" => "J", "K" => "K", "L" => "L", "M" => "M", "N" => " N" , "O" => "O" , "P" => "P" , "P" => "R" , "C" => "S" , "T" => "T" , "U " => "U" , "Ф" => "F" , "Х" => "X" , "Ц" => "C" , "Ч" => "CH" , "Ш" => "SH " , "Ш" => "SHH" , "Ъ" => """ , "ы" => "Y" , "b" => "" , "Э" => "E" , "У" = > "YU" , "I" => "YA" , "a" => "a" , "b" => "b" , "c" => "v" , "g" => "g" , "d" => "d" , "e" => "e" , "ё" => "yo" , "zh" => "zh" , "z" => "z" , "i" => "i" , "th" => "j" , "k" => "k" , "l" => "l" , "m" => "m" , "n" => "n" , " o" => "o" , "p" => "p" , "p" => "r" , "s" => "s" , "t" => "t" , "y" => " u" , "f" => "f" , "x" => "x" , "ts" => "c" , "ch" => "ch" , "sh" => "sh" , "sch " => "shh" , "ъ" => "" , "ы" => "y" , "ь" => "" , "е" => "e" , "yu" => "yu" , "I" => "ya" , """ => "" , """ => "" , "-" => "-" ) ; function sanitize_title_with_translit($title ) ( global $gost , $iso ; $rtl_standard = get_option("rtl_standard" ) ; switch ($rtl_standard ) ( case "off" : return $title ; case "gost" : return strtr ($title , $gost ) ; default : return strtr ( $title , $iso ) ) add_action ( "sanitize_title" , "sanitize_title_with_translit" , 0 ) ;

      //rus-to-lat $gost = array("Є"=>"EH","І"=>"I","i"=>"i","№"=>"#","є "=>"eh", "A"=>"A", "B"=>"B", "C"=>"V",,"G"=>"G",,"D"=>"D ", "E"=>"E", "Ё"=>"JO", "Zh"=>"ZH", "Z"=>"Z", "I"=>"I", "Y" =>"JJ","K"=>"K","L"=>"L", "M"=>"M","N"=>"N","O"=>"O" ,"P"=>"P","P"=>"R", "S"=>"S","T"=>"T","U"=>"U","F"= >"F","Х"=>"KH", "Ц"=>"C", "Ч"=>"CH", "Ш"=>"SH", "Ш"=>"SHH", "Ъ"=>""", "И"=>"Y", "ь"=>"",,"Э"=>"EH", "У"=>"YU", "Я"=>" YA", "a"=>"a", "b"=>"b", "c"=>"v", "g"=>"g", "d"=>"d", "e "=>"e","е"=>"jo","zh"=>"zh", "z"=>"z","i"=>"i","th"=>"jj ","k"=>"k","l"=>"l", "m"=>"m","n"=>"n","o"=>"o","p" =>"p","p"=>"r", "s"=>"s","t"=>"t","y"=>"u","f"=>"f" ,"x"=>"kh", "ts"=>"c","ch"=>"ch","sh"=>"sh","sh"=>"shh","b"= >"", "ы"=>"y",,"ь"=>"",,"е"=>"eh",,"yu"=>"yu",,"я"=>"ya",,"« "=>"","""=>"","-"=>"-"); $iso = array("Є"=>"YE","I"=>"I","Ѓ" =>"G","i"=>"i","No"=>"#","є"=>"ye","ѓ"=>"g", "A"=>"A" ,"B"=>"B","B"=>"V","G"=>"G","D"=>"D", "E"=>"E","Y"= >"YO","Zh"=>"ZH", "Z"=>"Z","I"=>"I","Y"=>"J","K"=>"K", "L"=>"L", "M"=>"M", "N"=>"N",,"O"=>"O",,"P"=>"P",,"P"=> "R", "С"=>"S", "Т"=>"T", "У"=>"U", "Ф"=>"F", "Х"=>"X", " Ц"=>"C", "Ч"=>"CH", "Ш"=>"SH", "Ш"=>"SHH", "Ъ"=>""", "ы"=>" Y","b"=>"","E"=>"E","Yu"=>"YU","I"=>"YA", "a"=>"a","b" =>"b","v"=>"v","g"=>"g","d"=>"d", "e"=>"e","yo"=>"yo" ,"zh"=>"zh", "z"=>"z","i"=>"i","th"=>"j","k"=>"k","l"= >"l", "m"=>"m",,"n"=>"n",,"o"=>"o",,"p"=>"p",,"p"=>"r", "s"=>"s","t"=>"t","y"=>"u","f"=>"f","x"=>"x", "ts"=> "c","ch"=>"ch","sh"=>"sh","sch"=>"shh","b"=>"", "ы"=>"y","ь "=>"","e"=>"e","yu"=>"yu","ya"=>"ya","""=>"","""=>""," -"=>"-"); function sanitize_title_with_translit($title) ( global $gost, $iso; $rtl_standard = get_option("rtl_standard"); switch ($rtl_standard) ( case "off": return $title; case "gost": return strtr($title, $gost); default: return strtr($title, $iso); add_action("sanitize_title", "sanitize_title_with_translit", 0);

      After this, all Russian characters in links will become Latin. Well, setting up CNC in WordPress is very simple. Go to the parameters - permalinks and set the radio button to Custom or Post name. That's all. I hope you don't have any problems with this. At least everything works fine for me. If anything, write in the comments about any problems that arise. We'll decide together. By the way, there is also a free one. Allows you to create a template based on your wishes.

      Relatively recently, a few months ago, I accidentally came across exactly what I had been looking for for so long. The script was working, but there were still minor flaws, plus a bug with Google, I’ll write about it a little later. Let's start implementing the rating. An example is below in the picture or under any article on this site. You can check how it works by clicking on 5 stars. Somehow not modest, right? 🙂

      There are two ways to set a rating for your website. Add all rating codes to separate files, place them in one folder, upload them to your WordPress theme, and then connect everything in the theme code. You can also simply paste all the codes directly into the theme files, which is what I did. In any case, first, download the archive with the rating files.

      If you decide to leave it in a separate folder, then add the folder from the archive to your topic. Afterwards, connect everything in order.

    • Open header.php and before the closing head, connect the Java file and the rating style file:

    Close