{"category":{"id":3,"name":"Ununtu","slug":"ununtu","description":null,"created_at":"2022-11-15T17:03:42.000000Z","updated_at":"2022-11-15T17:03:42.000000Z"},"category_posts":{"current_page":1,"data":[{"id":3,"title":"How to install Wine on ubuntu 20.04","slug":"how-to-install-wine-on-ubuntu-20.04","image":"1689835550.jpg","description":"<div class=\"containerx\">\r\n<span style=\"font-size: 18.2858px;\">There are two methods available For Installing Wine in Ubuntu. In this tutorial, we will see both of the methods.<\/span>\r\n<h4 style=\"text-align: left;\"><span style=\"font-size: 18.2858px;\">In This Tutorial We Will Learn:<\/span><\/h4>\r\n<span font-size:=\"\" 18.2858px;\"=\"\">-how to install wine on Ubuntu 20.04<\/span>\r\n<span font-size:=\"\" 18.2858px;\"=\"\">-how to install wine on Ubuntu 18.04<\/span>\r\n<span font-size:=\"\" 18.2858px;\"=\"\">-how to install wine on Ubuntu 16.04<\/span>\r\n\r\n<h3 border:=\"\" 0px;=\"\" box-sizing:=\"\" border-box;=\"\" font-family:=\"\" poppins;=\"\" font-size:=\"\" 20px;=\"\" line-height:=\"\" 1.29;=\"\" margin:=\"\" 0px=\"\" 10px;=\"\" outline:=\"\" overflow-wrap:=\"\" break-word;=\"\" padding:=\"\" vertical-align:=\"\" baseline;\"=\"\">Method 1:<\/h3>\r\n<p style=\"border: 0px; box-sizing: border-box; font-family: Arimo, sans-serif; font-size: 18.2858px; margin: 0px 0px 30px; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;\">The Wine tool is available in the Ubuntu 20.04 repository, and the recommended method to install a stable version is through the Ubuntu repository.<\/p>\r\n\r\n\r\n\r\n\r\n\r\n    <pre><code class=\"hljs lang-terminal\">\r\nsudo dpkg --add-architecture i386\r\nwget -qO - https:\/\/dl.winehq.org\/wine-builds\/winehq.key | sudo apt-key add -\r\n<\/code><\/pre>\r\n\r\n\r\n\r\n\r\n\r\n\r\n<span style=\"font-weight: normal;\"><span font-size:=\"\" 18.2858px;\"=\"\">###&nbsp; Ubuntu 20.04\r\n<\/span>\r\n    <pre><code class=\"hljs lang-terminal\">\r\nsudo add-apt-repository \u2018deb https:\/\/dl.winehq.org\/wine-builds\/ubuntu\/ focal main\u2019<\/code><\/pre>\r\n<\/span><\/div>\r\n\r\n\r\n\r\n\r\n<span style=\"font-weight: normal;\"><span><span style=\"font-size: 18.2858px;\">###&nbsp; Ubuntu 19.04<\/span><\/span>\r\n    <pre><code class=\"hljs lang-terminal\">\r\nsudo apt-add-repository 'deb https:\/\/dl.winehq.org\/wine-builds\/ubuntu\/ disco main'\r\n<\/code><\/pre>\r\n<\/span>\r\n\r\n<span style=\"font-weight: normal;\"><span style=\"font-size: 18.2858px;\">###&nbsp; Ubuntu 18.04\r\n<\/span>\r\n    <pre><code class=\"hljs lang-terminal\">\r\nsudo apt-add-repository 'deb https:\/\/dl.winehq.org\/wine-builds\/ubuntu\/ bionic main'\r\n<\/code><\/pre>\r\n<\/span>\r\n\r\n\r\n<span style=\"font-weight: normal;\"><span font-size:=\"\" 18.2858px;\"=\"\">###&nbsp; Ubuntu 16.04\r\n<\/span>\r\n    <pre><code class=\"hljs lang-terminal\">\r\nsudo apt-add-repository 'deb https:\/\/dl.winehq.org\/wine-builds\/ubuntu\/ xenial main'\r\n<\/code><\/pre>\r\n<\/span>\r\n\r\n\r\n\r\n<span style=\"font-weight: normal;\"><span font-size:=\"\" 18.2858px;\"=\"\">###&nbsp; Ubuntu 16.04\r\n<\/span>\r\n    <pre><code class=\"hljs lang-terminal\">\r\nsudo apt-get update\r\nsudo apt-get install --install-recommends winehq-stable\r\nwine --version\r\n<\/code><\/pre>\r\n<\/span>\r\n\r\n\r\n\r\n\r\n<h3 style=\"-webkit-font-smoothing: antialiased; border: 0px; box-sizing: border-box; font-family: Poppins; font-size: 20px; line-height: 1.29; margin: 0px 0px 10px; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;\">Method 2:<\/h3>\r\n<p style=\"border: 0px; box-sizing: border-box; font-family: Arimo, sans-serif; font-size: 18.2858px; margin: 0px 0px 30px; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;\">To install Wine via Wine build repository, you have to remove all other wine packages such as the wine-mono or the winetricks; otherwise, it will cause dependency conflicts.<\/p>\r\n\r\n\r\n\r\n\r\n    <pre><code class=\"hljs lang-terminal\">\r\nsudo dpkg --add-architecture i386\r\nwget -nc https:\/\/dl.winehq.org\/wine-builds\/winehq.key; sudo apt-key add winehq.key\r\nsudo add-apt-repository ppa:cybermax-dexter\/sdl2-backport\r\nsudo apt update &amp;&amp; sudo apt install --install-recommends winehq-stable\r\n<\/code><\/pre>\r\n\r\n\r\n\r\n\r\n<h3 style=\"-webkit-font-smoothing: antialiased; border: 0px; box-sizing: border-box; font-family: Poppins; font-size: 20px; line-height: 1.29; margin: 0px 0px 10px; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;\">Conclusion:<\/h3>\r\n<p style=\"border: 0px; box-sizing: border-box; font-family: Arimo, sans-serif; font-size: 18.2858px; margin: 0px; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline;\">I have shown you how to install all the different versions of the WineHQ utility tool in Ubuntu. Wine is one of the handiest tools, it runs most of the windows executable programs on Linux.<\/p>","meta_description":null,"category_id":3,"user_id":1,"published_at":"2022-11-15 17:05:58","total_views":194,"status":"publish","created_at":"2022-11-15T17:05:58.000000Z","updated_at":"2024-05-31T06:24:15.000000Z","category":{"id":3,"name":"Ununtu","slug":"ununtu","description":null,"created_at":"2022-11-15T17:03:42.000000Z","updated_at":"2022-11-15T17:03:42.000000Z"},"user":{"id":1,"name":"Admin","email":"admin@gmail.com","email_verified_at":null,"created_at":null,"updated_at":null}},{"id":7,"title":"INSTALLING, CONFIGURING AND UNINSTALLING XAMPP IN UBUNTU","slug":"installing-configuring-and-uninstalling-xampp-in-ubuntu","image":"1691946045.jpg","description":"<p data-adtags-visited=\"true\">Open terminal and execute following commands<\/p>\r\n<p data-adtags-visited=\"true\">for 32 bit\r\nwget&nbsp;<a href=\"http:\/\/sourceforge.net\/projects\/xampp\/files\/XAMPP%20Linux\/1.8.3\/xampp-linux-1.8.3-2-installer.run\/download\" rel=\"nofollow\">http:\/\/sourceforge.net\/projects\/xampp\/files\/XAMPP%20Linux\/1.8.3\/xampp-linux-1.8.3-2-installer.run\/download<\/a><\/p>\r\n<p data-adtags-visited=\"true\">for 64 bit\r\nwget&nbsp;<a href=\"http:\/\/sourceforge.net\/projects\/xampp\/files\/XAMPP%20Linux\/1.8.3\/xampp-linux-x64-1.8.3-2-installer.run\/download\" rel=\"nofollow\">http:\/\/sourceforge.net\/projects\/xampp\/files\/XAMPP%20Linux\/1.8.3\/xampp-linux-x64-1.8.3-2-installer.run\/download<\/a><\/p>\r\n<p data-adtags-visited=\"true\">Then, executing the following commands will open the installer wizard<\/p>\r\n<p data-adtags-visited=\"true\">sudo chmod +x xampp-linux-x64-1.8.3-2<span class=\"skimlinks-unlinked\">-installer.run<\/span>\r\nsudo .\/xampp-linux-x64-1.8.3-2<span class=\"skimlinks-unlinked\">-installer.run<\/span><\/p>\r\n<p data-adtags-visited=\"true\">Then to start with the projects, you have to change the permission for htdocs folder by<\/p>\r\n<p data-adtags-visited=\"true\">sudo chmod 777 -R \/opt\/lampp\/htdocs<\/p>\r\n<p data-adtags-visited=\"true\">To Start and Stop Xampp,\r\nsudo \/opt\/lampp\/lampp stop\r\nsudo \/opt\/lampp\/lampp start<\/p>\r\n<p data-adtags-visited=\"true\">To get the GUI control panel of Xampp,<\/p>\r\n<p data-adtags-visited=\"true\">sudo \/opt\/lampp\/share\/xampp-control-panel\/<span class=\"skimlinks-unlinked\">xampp-control-panel.py<\/span>&nbsp;(make sure you have installed python in your computer to use this)<\/p>\r\n<p data-adtags-visited=\"true\"><\/p>\r\n<p data-adtags-visited=\"true\">To Uninstall Xampp, use\r\nsudo -i\r\ncd \/opt\/lampp\r\n.\/uninstall\r\nexit<\/p>","meta_description":null,"category_id":3,"user_id":1,"published_at":"2022-11-15 19:41:46","total_views":187,"status":"publish","created_at":"2022-11-15T19:41:46.000000Z","updated_at":"2023-10-12T14:41:52.000000Z","category":{"id":3,"name":"Ununtu","slug":"ununtu","description":null,"created_at":"2022-11-15T17:03:42.000000Z","updated_at":"2022-11-15T17:03:42.000000Z"},"user":{"id":1,"name":"Admin","email":"admin@gmail.com","email_verified_at":null,"created_at":null,"updated_at":null}}],"first_page_url":"https:\/\/backend.wesoftpress.com\/api\/blog\/category\/ununtu?page=1","from":1,"last_page":1,"last_page_url":"https:\/\/backend.wesoftpress.com\/api\/blog\/category\/ununtu?page=1","links":[{"url":null,"label":"&laquo; Previous","active":false},{"url":"https:\/\/backend.wesoftpress.com\/api\/blog\/category\/ununtu?page=1","label":"1","active":true},{"url":null,"label":"Next &raquo;","active":false}],"next_page_url":null,"path":"https:\/\/backend.wesoftpress.com\/api\/blog\/category\/ununtu","per_page":12,"prev_page_url":null,"to":2,"total":2},"latest_posts":{"current_page":1,"data":[{"id":47,"title":"Estimated Reading Time Calculate in Laravel","slug":"estimated-reading-time-calculate-in-laravel","image":"1695704483.png","description":"<p style=\"margin-bottom: 1rem; font-size: 17px; line-height: 28px; font-family: Inter, sans-serif;\"><font color=\"#000000\"><br><\/font><\/p><p style=\"margin-bottom: 1rem; font-size: 17px; line-height: 28px; font-family: Inter, sans-serif;\"><font color=\"#000000\">Hi artisans, in this snippet, we are going to learn how to calculate estimated reading time in Laravel. We'll use Laravel Macro.<\/font><\/p><p style=\"margin-bottom: 1rem; font-size: 17px; line-height: 28px; font-family: Inter, sans-serif;\"><font color=\"#000000\">In Laravel, a macro is a way to extend the functionality of a class by adding custom methods to it at runtime. This means you can add new methods to a class without having to modify the class itself. Macros can be used on various Laravel classes such as Collection, Request, Response, etc.<\/font><\/p><div class=\"raw-html-embed\" style=\"color: rgb(161, 161, 168); font-family: Inter, sans-serif; font-size: 15px; background-color: rgb(20, 21, 25);\"><h2 id=\"step1\" class=\"step\" style=\"margin-bottom: 0.5em; font-family: Inter, sans-serif; line-height: 1.25; color: rgb(0, 0, 0); background-color: rgb(203, 203, 203); border-left: 5px solid rgb(104, 100, 100); border-top: 1px solid rgb(104, 100, 100); border-bottom: 1px solid rgb(104, 100, 100); display: inline-block; padding: 5px 7px; width: 704.672px; font-size: 20px !important;\">Create Reading Time Macro<\/h2><\/div><p style=\"margin-bottom: 1rem; font-size: 17px; color: rgba(187, 187, 187, 0.976); line-height: 28px; font-family: Inter, sans-serif; background-color: rgb(20, 21, 25);\">Open&nbsp;<code style=\"font-family: Menlo, monospace; font-size: 0.78em; --bg-opacity: 1; padding: 0.2rem 0.33rem; vertical-align: 1%; background-color: rgb(135, 135, 135); border: 1px solid rgb(135, 135, 135); border-radius: 5px; color: rgb(233, 233, 233) !important;\">app\\Providers\\AppServiceProvider.php<\/code>&nbsp;file and in the&nbsp;<code style=\"font-family: Menlo, monospace; font-size: 0.78em; --bg-opacity: 1; padding: 0.2rem 0.33rem; vertical-align: 1%; background-color: rgb(135, 135, 135); border: 1px solid rgb(135, 135, 135); border-radius: 5px; color: rgb(233, 233, 233) !important;\">boot()<\/code>&nbsp;method add this macro:<\/p><div class=\"code-toolbar\" style=\"position: relative; color: rgb(161, 161, 168); font-family: Inter, sans-serif; font-size: 15px; background-color: rgb(20, 21, 25);\"><pre class=\"language-php\" tabindex=\"0\" style=\"font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; max-height: 500px; border: 0px; border-radius: 4px; background: 0px 0px; tab-size: 2; color: rgb(179, 185, 197); padding: 0px; direction: ltr; word-spacing: normal; word-break: normal; line-height: 1.4; hyphens: none; -webkit-font-smoothing: subpixel-antialiased;\"><code class=\"language-php\" style=\"font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; color: rgb(179, 185, 197); direction: ltr; word-spacing: normal; line-height: 1.4; tab-size: 2; hyphens: none; -webkit-font-smoothing: subpixel-antialiased; display: block; padding: 1rem; overflow: auto; background-color: rgb(51, 51, 51); box-shadow: rgba(0, 0, 0, 0.15) 2px 4px 25px;\"><span class=\"token keyword\" style=\"color: rgb(255, 238, 173);\">use<\/span> <span class=\"token package\">Illuminate<span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">\\<\/span>Support<span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">\\<\/span>Str<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">;<\/span>\r\n\r\n<span class=\"token comment\" style=\"color: rgb(119, 124, 133);\">\/\/ macro: reading time<\/span>\r\n<span class=\"token class-name static-context\" style=\"color: rgb(225, 166, 242);\">Str<\/span><span class=\"token operator\" style=\"color: rgb(172, 141, 88);\">::<\/span><span class=\"token function\" style=\"color: rgb(255, 255, 255);\">macro<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">(<\/span><span class=\"token string single-quoted-string\" style=\"color: rgb(146, 209, 146);\">'readingTime'<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">,<\/span> <span class=\"token keyword\" style=\"color: rgb(255, 238, 173);\">function<\/span> <span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">(<\/span><span class=\"token variable\" style=\"color: rgb(242, 119, 122);\">$text<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">)<\/span> <span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">{<\/span>\r\n    <span class=\"token variable\" style=\"color: rgb(242, 119, 122);\">$totalWords<\/span> <span class=\"token operator\" style=\"color: rgb(172, 141, 88);\">=<\/span> <span class=\"token function\" style=\"color: rgb(255, 255, 255);\">str<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">(<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">)<\/span><span class=\"token operator\" style=\"color: rgb(172, 141, 88);\">-&gt;<\/span><span class=\"token function\" style=\"color: rgb(255, 255, 255);\">wordCount<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">(<\/span><span class=\"token variable\" style=\"color: rgb(242, 119, 122);\">$text<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">)<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">;<\/span>\r\n    <span class=\"token variable\" style=\"color: rgb(242, 119, 122);\">$minutesToRead<\/span> <span class=\"token operator\" style=\"color: rgb(172, 141, 88);\">=<\/span> <span class=\"token function\" style=\"color: rgb(255, 255, 255);\">round<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">(<\/span><span class=\"token variable\" style=\"color: rgb(242, 119, 122);\">$totalWords<\/span> <span class=\"token operator\" style=\"color: rgb(172, 141, 88);\">\/<\/span> <span class=\"token number\" style=\"color: rgb(119, 227, 142);\">200<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">,<\/span> <span class=\"token number\" style=\"color: rgb(119, 227, 142);\">1<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">)<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">;<\/span>\r\n\r\n    <span class=\"token keyword\" style=\"color: rgb(255, 238, 173);\">return<\/span> <span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">(<\/span><span class=\"token keyword type-casting\" style=\"color: rgb(255, 238, 173);\">int<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">)<\/span><span class=\"token function\" style=\"color: rgb(255, 255, 255);\">max<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">(<\/span><span class=\"token number\" style=\"color: rgb(119, 227, 142);\">1<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">,<\/span> <span class=\"token variable\" style=\"color: rgb(242, 119, 122);\">$minutesToRead<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">)<\/span> <span class=\"token operator\" style=\"color: rgb(172, 141, 88);\">.<\/span> <span class=\"token string single-quoted-string\" style=\"color: rgb(146, 209, 146);\">' min'<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">;<\/span>\r\n<span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">}<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">)<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">;<\/span><\/code><\/pre><div class=\"toolbar\" style=\"position: absolute; top: 0.3em; right: 0.2em; transition: opacity 0.3s ease-in-out; opacity: 0;\"><div class=\"toolbar-item\"><button class=\"copy-to-clipboard-button\" type=\"button\" data-copy-state=\"copy\" style=\"border-radius: 0.5em; font-size: 0.8em; line-height: normal; border-width: 0px; border-style: initial; border-color: initial; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; user-select: none; color: rgb(187, 187, 187); padding: 0px 0.5em; background: rgba(224, 224, 224, 0.2); box-shadow: rgba(0, 0, 0, 0.2) 0px 2px;\">Copy<\/button><\/div><\/div><\/div><p style=\"margin-bottom: 1rem; font-size: 17px; color: rgba(187, 187, 187, 0.976); line-height: 28px; font-family: Inter, sans-serif; background-color: rgb(20, 21, 25);\">Here, we extended Laravel&nbsp;<code style=\"font-family: Menlo, monospace; font-size: 0.78em; --bg-opacity: 1; padding: 0.2rem 0.33rem; vertical-align: 1%; background-color: rgb(135, 135, 135); border: 1px solid rgb(135, 135, 135); border-radius: 5px; color: rgb(233, 233, 233) !important;\">Str<\/code>&nbsp;class and 200 (words per min) is the average reading speed.<\/p><p style=\"margin-bottom: 1rem; font-size: 17px; color: rgba(187, 187, 187, 0.976); line-height: 28px; font-family: Inter, sans-serif; background-color: rgb(20, 21, 25);\">The average reading time can vary depending on factors such as reading speed, complexity of the material, and familiarity with the subject matter. However, a rough estimate for the average reading time for an adult is around 200-300 words per minute.<\/p><div class=\"raw-html-embed\" style=\"color: rgb(161, 161, 168); font-family: Inter, sans-serif; font-size: 15px; background-color: rgb(20, 21, 25);\"><h2 id=\"step2\" class=\"step\" style=\"margin-bottom: 0.5em; font-family: Inter, sans-serif; line-height: 1.25; color: rgb(0, 0, 0); background-color: rgb(203, 203, 203); border-left: 5px solid rgb(104, 100, 100); border-top: 1px solid rgb(104, 100, 100); border-bottom: 1px solid rgb(104, 100, 100); display: inline-block; padding: 5px 7px; width: 704.672px; font-size: 20px !important;\">Use the Marco<\/h2><\/div><p style=\"margin-bottom: 1rem; font-size: 17px; color: rgba(187, 187, 187, 0.976); line-height: 28px; font-family: Inter, sans-serif; background-color: rgb(20, 21, 25);\">Now, we can easily use the&nbsp;<code style=\"font-family: Menlo, monospace; font-size: 0.78em; --bg-opacity: 1; padding: 0.2rem 0.33rem; vertical-align: 1%; background-color: rgb(135, 135, 135); border: 1px solid rgb(135, 135, 135); border-radius: 5px; color: rgb(233, 233, 233) !important;\">readingTime()<\/code>&nbsp;Macro like Laravel&nbsp;<code style=\"font-family: Menlo, monospace; font-size: 0.78em; --bg-opacity: 1; padding: 0.2rem 0.33rem; vertical-align: 1%; background-color: rgb(135, 135, 135); border: 1px solid rgb(135, 135, 135); border-radius: 5px; color: rgb(233, 233, 233) !important;\">Str<\/code>&nbsp;methods anywhere in our application.<\/p><div class=\"code-toolbar\" style=\"position: relative; color: rgb(161, 161, 168); font-family: Inter, sans-serif; font-size: 15px; background-color: rgb(20, 21, 25);\"><pre class=\"language-php\" tabindex=\"0\" style=\"font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; max-height: 500px; border: 0px; border-radius: 4px; background: 0px 0px; tab-size: 2; color: rgb(179, 185, 197); padding: 0px; direction: ltr; word-spacing: normal; word-break: normal; line-height: 1.4; hyphens: none; -webkit-font-smoothing: subpixel-antialiased;\"><code class=\"language-php\" style=\"font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: 14px; color: rgb(179, 185, 197); direction: ltr; word-spacing: normal; line-height: 1.4; tab-size: 2; hyphens: none; -webkit-font-smoothing: subpixel-antialiased; display: block; padding: 1rem; overflow: auto; background-color: rgb(51, 51, 51); box-shadow: rgba(0, 0, 0, 0.15) 2px 4px 25px;\"><span class=\"token variable\" style=\"color: rgb(242, 119, 122);\">$readingTime<\/span> <span class=\"token operator\" style=\"color: rgb(172, 141, 88);\">=<\/span> <span class=\"token function\" style=\"color: rgb(255, 255, 255);\">str<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">(<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">)<\/span><span class=\"token operator\" style=\"color: rgb(172, 141, 88);\">-&gt;<\/span><span class=\"token function\" style=\"color: rgb(255, 255, 255);\">readingTime<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">(<\/span><span class=\"token string double-quoted-string\" style=\"color: rgb(146, 209, 146);\">\"This is an article!\"<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">)<\/span><span class=\"token punctuation\" style=\"color: rgb(213, 216, 223);\">;<\/span> <span class=\"token comment\" style=\"color: rgb(119, 124, 133);\">\/\/ 1 min read<\/span><\/code><\/pre><div class=\"toolbar\" style=\"position: absolute; top: 0.3em; right: 0.2em; transition: opacity 0.3s ease-in-out; opacity: 0;\"><div class=\"toolbar-item\"><button class=\"copy-to-clipboard-button\" type=\"button\" data-copy-state=\"copy\" style=\"border-radius: 0.5em; font-size: 0.8em; line-height: normal; border-width: 0px; border-style: initial; border-color: initial; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; user-select: none; color: rgb(187, 187, 187); padding: 0px 0.5em; background: rgba(224, 224, 224, 0.2); box-shadow: rgba(0, 0, 0, 0.2) 0px 2px;\">Copy<\/button><\/div><\/div><\/div><p style=\"margin-bottom: 1rem; font-size: 17px; color: rgba(187, 187, 187, 0.976); line-height: 28px; font-family: Inter, sans-serif; background-color: rgb(20, 21, 25);\">That's all. Happy coding \u2764\ufe0f!<\/p>","meta_description":null,"category_id":5,"user_id":1,"published_at":"2024-12-27 11:39:12","total_views":0,"status":"publish","created_at":"2024-12-27T11:39:12.000000Z","updated_at":"2024-12-27T15:58:44.000000Z"},{"id":46,"title":"1409. Two Gangsters - Problem Solution & Logic","slug":"1409-two-gangsters-problem-solution-logic","image":null,"description":"<p>#include &lt;cstdio&gt;<\/p><p><br><\/p><p>using namespace std;<\/p><p><br><\/p><p>int main(){<\/p><p>&nbsp; &nbsp; int x,y;<\/p><p>&nbsp; &nbsp; scanf(\"%d %d\",&amp;x,&amp;y);<\/p><p>&nbsp; &nbsp; printf(\"%d %d\\n\",y-1,x-1);<\/p><p><br><\/p><p>&nbsp; &nbsp; return 0;<\/p><p>}<\/p>","meta_description":null,"category_id":5,"user_id":1,"published_at":"2024-06-08 09:41:23","total_views":0,"status":"publish","created_at":"2024-06-08T09:41:23.000000Z","updated_at":"2024-06-08T09:41:23.000000Z"},{"id":45,"title":"1293. Eniya - Problem Solution & Logic","slug":"1293-eniya-problem-solution-logic","image":null,"description":"<pre style=\"color: rgb(255, 238, 221); font-size: 13.524px; background-color: rgb(68, 21, 0);\">#include&lt;iostream&gt;\r\n#include&lt;cstdio&gt;\r\n\r\nusing namespace std;\r\n\r\nint main()\r\n\r\n{\r\n    int n,b,c;\r\n    cin&gt;&gt;n&gt;&gt;b&gt;&gt;c;\r\n    cout&lt;&lt;2*n*b*c&lt;&lt;endl;\r\n    return 0;\r\n}<\/pre>","meta_description":null,"category_id":5,"user_id":1,"published_at":"2024-06-08 09:00:54","total_views":0,"status":"publish","created_at":"2024-06-08T09:00:54.000000Z","updated_at":"2024-06-08T09:00:54.000000Z"},{"id":44,"title":"1264. Workdays - Problem Solution & Logic","slug":"1264-workdays-problem-solution-logic","image":null,"description":"<p>#include &lt;cstdio&gt;<\/p><p><br><\/p><p>using namespace std;<\/p><p><br><\/p><p>int main(){<\/p><p>&nbsp; &nbsp; long long N,M;<\/p><p>&nbsp; &nbsp; scanf(\"%lld %lld\",&amp;N,&amp;M);<\/p><p>&nbsp; &nbsp;&nbsp;<\/p><p>&nbsp; &nbsp; printf(\"%lld\\n\",N*(M+1));<\/p><p>&nbsp; &nbsp;&nbsp;<\/p><p>&nbsp; &nbsp; return 0;<\/p><p>}<\/p><div><br><\/div>","meta_description":null,"category_id":5,"user_id":1,"published_at":"2024-06-08 07:40:35","total_views":0,"status":"publish","created_at":"2024-06-08T07:40:35.000000Z","updated_at":"2024-06-08T07:40:35.000000Z"},{"id":37,"title":"Timus 1068. Sum - Problem Solution & Logic","slug":"timus-1068-sum-problem-solution-logic","image":null,"description":"Almost every online judge has a \u201cA+B\u201d problem. The first problem (easiest) is often present to allow testing if online judges are working (of course they are!)\r\n\r\nThis problem can be found at Timus Online Judge.\r\n\r\nOf course, almost every registered users will AC this simple problem after immediate registration, to boost their confidence.\r\n\r\nThis problem, is so simple, but don\u2019t have so much details\u2026 for example, the range of inputs are unknown.\r\n\r\nThe Solution of the problem in C++ is :\r\n\r\n<pre><code>\r\n#include<stdio.h>\r\n\r\nint main(){\r\n    int a, b;\r\n    scanf(\"%d %d\", &amp;a, &amp;b);\r\n    printf(\"%d\\n\", a+b);\r\n    return 0;\r\n}\r\n<\/stdio.h><\/code>\r\n<\/pre>","meta_description":null,"category_id":5,"user_id":1,"published_at":"2022-11-26 16:30:45","total_views":339,"status":"publish","created_at":"2022-11-26T16:30:45.000000Z","updated_at":"2023-10-10T14:54:53.000000Z"},{"id":36,"title":"Remove Custom Post Type Name from Permalink in WordPress","slug":"remove-custom-post-type-name-from-permalink-in-wordpress","image":null,"description":"If you are a WordPress developer and love to create custom post types to addon the new feature in your project then this article is very helpful for you.\r\n\r\nWhen you create a new custom post type in WordPress then you can see that by default, its slug will show in the permalink URL structure. Adding slug to permalink displays the post type of the current post and creates the URLs longer which is hard to remember. Also, it creates an issue to rank articles in Google.\r\n\r\nSo now I will cover all steps to remove slug from custom post type to make URL shorter and easy to remember.\r\n<h2 id=\"custom-post-type-in-wordpress\">Custom Post Type in WordPress<\/h2>\r\nRecently, I created a custom post type called&nbsp;<strong>\u201cPost Type\u201d<\/strong>&nbsp;for a company. This resulted in permalinks such as&nbsp;<code><strong>example.com\/post_type1\/post-title<\/strong><\/code>\r\n\r\n<span class=\"tadv-color\">As you can see, having permalinks like&nbsp;<code><strong>example.com\/post_type1\/post-title<\/strong><\/code>&nbsp;is not nearly as clean, also not easy to remember and search engine optimized.<\/span>\r\n\r\n<span class=\"tadv-color\">But having permalinks like&nbsp;<code><strong>example.com\/post-title<\/strong><\/code>&nbsp;is nearly as clean, easy to remember, and SEO friendly.<\/span>\r\n\r\nAs SEO (Search Engine Optimization) experts always suggest making URL shorter highly rank in Google.\r\n\r\nI hope now you are clear with the article\u2019s focused point. Now let\u2019s see the solution:\r\n<h2 id=\"remove-slug-from-custom-post-type\">Remove slug from custom post type<\/h2>\r\n<strong>Step-1:&nbsp;<\/strong><a title=\"Create your custom post type\" href=\"https:\/\/wesoftpress.com\/backup\/how-to-create-custom-post-type-taxonomy-category-in-wordpress\/\" target=\"_blank\" rel=\"noreferrer noopener\">Create your custom post type<\/a>&nbsp;if you are not already created it till now.\r\n\r\n<strong>Step-2:&nbsp;<\/strong>Copy and Paste the following code to your theme&nbsp;<strong>functions.php<\/strong>&nbsp;file to filter the permalink for our custom post type so that all published posts don\u2019t have the slug in their URLs:\r\n<pre style=\"position: relative;\"><code class=\"hljs lang-php\">&lt;?php \r\n\/**\r\n * Remove the slug from published post permalinks for our custom post types.\r\n *\/\r\nadd_filter( 'post_type_link', function( $post_link, $post, $leavename ) {\r\n\r\n\t$post_types = array(\r\n\t\t'post_type_1',\r\n\t\t'post_type_2'\r\n\t);\r\n\r\n\tif ( in_array( $post-&gt;post_type, $post_types ) &amp;&amp; 'publish' === $post-&gt;post_status ) {\r\n\t\t$post_link = str_replace( '\/' . $post-&gt;post_type . '\/', '\/', $post_link );\r\n\t}\r\n\r\n\treturn $post_link;\r\n\r\n}, 10, 3 );\r\n\r\n\/**\r\n * Some hackery to have WordPress match postname to any of our public post types.\r\n *\r\n * All of our public post types can have \/post-name\/ as the slug, so they better be unique across all posts\r\n * Typically core only accounts for posts and pages where the slug is \/post-name\/\r\n *\/\r\nadd_action( 'pre_get_posts', function( $query ) {\r\n\r\n\r\n\tif ( ! $query-&gt;is_main_query() || 2 != count( $query-&gt;query ) || ! isset( $query-&gt;query['page'] ) ) {\r\n        return;\r\n    }\r\n\r\n\t\/\/ 'name' will be set if post permalinks are just post_name, otherwise the page rule will match.\r\n\tif ( ! empty( $query-&gt;query['name'] ) ) {\r\n\r\n\t\t\t$post_types = array(\r\n\t\t\t'post', \/\/ important to  not break your standard posts\r\n\t\t\t'page', \/\/ important to  not break your standard pages\r\n\t\t\t'post_type_1',\r\n\t\t\t'post_type_12'\r\n\t\t);\r\n\r\n\t\t$query-&gt;set( 'post_type', $post_types );\r\n\r\n\t}\r\n\r\n} );\r\n?&gt;\r\n<\/code><\/pre>\r\nThat\u2019s it! Just replace &nbsp;\u201conline_services\u201d&nbsp;with the slug of your custom post type in both code samples. After this&nbsp;<strong>Go to&nbsp;<code>Settings<\/code>&nbsp;&gt;&nbsp;<code>Permalinks<\/code>&nbsp;<\/strong>and saving the permalink structure to end in&nbsp;<code>\/%postname%\/<\/code>&nbsp;may also be necessary.\r\n<h2 id=\"wrapping-words\">Wrapping Words!<\/h2>\r\nThanks for reading \ud83d\ude4f, I hope you found the&nbsp;<strong>Remove slug from custom post type in WordPress&nbsp;<\/strong>Without Plugin tutorial helpful for your project. Keep learning! If you face any problems \u2013 I am here to solve your problems.","meta_description":"remove custom post type name from url, remove custom post type name from wordpress","category_id":4,"user_id":1,"published_at":"2022-11-26 16:29:25","total_views":343,"status":"publish","created_at":"2022-11-26T16:29:25.000000Z","updated_at":"2024-08-21T17:04:30.000000Z"},{"id":35,"title":"Hide a div on clicking outside it with JavaScript\/jQuery","slug":"hide-a-div-on-clicking-outside-it-with-javascriptjquery","image":"1691946349.png","description":"Hey guys, today in this post we are going to learn about How to close a div container when clicking outside the target. We will use <strong>jQuery<\/strong> for that. <strong><em>jQuery<\/em><\/strong> is a fast, small, and feature-rich JavaScript library.\r\n\r\n<strong>We can use the following code:<\/strong>\r\n<em>1. A mouseup event is to first checked upon the document.<\/em>\r\n<em>3. The element is checked for 2 things, that the click does not land on the element by passing the is() method and the has() method with the click target.<\/em>\r\n\r\nThe is() method check the current element against the specified element. The click target is passed as a parameter and the whole result is negated to essentially check if the click was outside the element.\r\n\r\nThe has() method is used to return all the elements which match at least one of the elements passed to this method. The length property is then used on the result to check if any elements are returned. If there are no elements returned, it means that the click was outside the element.\r\n3. The element is hidden using the hide() method.\r\n<pre style=\"position: relative;\"><code class=\"hljs lang-jQuery\">$(<span class=\"hljs-variable language_\">document<\/span>).<span class=\"hljs-title function_\">mouseup<\/span>(<span class=\"hljs-keyword\">function<\/span>(<span class=\"hljs-params\">e<\/span>) \r\n{\r\n    <span class=\"hljs-keyword\">var<\/span> container = $(<span class=\"hljs-string\">\"YOUR CONTAINER SELECTOR\"<\/span>);\r\n\r\n    <span class=\"hljs-comment\">\/\/ if the target of the click isn't the container nor a descendant of the container<\/span>\r\n    <span class=\"hljs-keyword\">if<\/span> (!container.<span class=\"hljs-title function_\">is<\/span>(e.<span class=\"hljs-property\">target<\/span>) &amp;&amp; container.<span class=\"hljs-title function_\">has<\/span>(e.<span class=\"hljs-property\">target<\/span>).<span class=\"hljs-property\">length<\/span> === <span class=\"hljs-number\">0<\/span>) \r\n    {\r\n        container.<span class=\"hljs-title function_\">hide<\/span>();\r\n    }\r\n});<\/code><\/pre>","meta_description":null,"category_id":4,"user_id":1,"published_at":"2022-11-26 16:28:15","total_views":333,"status":"publish","created_at":"2022-11-26T16:28:15.000000Z","updated_at":"2023-10-12T22:47:20.000000Z"},{"id":34,"title":"How to Fix Android License Status Unknown In Flutter?","slug":"how-to-fix-android-license-status-unknown-in-flutter","image":null,"description":"<div itemprop=\"text\"><p>follow these steps:<\/p>  <li>open SDK Manager<\/li><li>go to SDK tools<\/li><li>Install \"Android sdk command line tool(latest)\"<\/li><\/div><div style=\"clear: both; text-align: center;\"><br><\/div><div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/wesoftpress.com\/backup\/wp-content\/uploads\/2021\/05\/xJ5MX.png\" style=\"margin-left: 1em; margin-right: 1em;\"><img border=\"0\" data-original-height=\"483\" data-original-width=\"772\" height=\"250\" src=\"https:\/\/wesoftpress.com\/backup\/wp-content\/uploads\/2021\/05\/xJ5MX-300x188.png\" width=\"400\"><\/a><\/div><div style=\"clear: both; text-align: center;\"><br><\/div><div><br><\/div> <li>check it and apply and let the studio download the package <\/li><li>once done run the command <span style=\"background-color: #4c1130; color: white;\">flutter doctor<\/span> and it should now prompt you to run <span style=\"background-color: #4c1130; color: white;\">flutter doctor --android-licenses<\/span>once you run the license command accept all licenses by <span style=\"color: #cc0000;\">hitting y<\/span> and it should solve the problem<\/li><div><br><\/div><p style=\"text-align: left;\"><b>  This Will Solve The Issue-<\/b><\/p><div>&nbsp;IF the Issue Is Still There&nbsp; - follow these steps:<\/div><div><div itemprop=\"text\"><li>open SDK Manager<\/li><li>under SDK tools uncheck hide obsolete packages at the bottom<\/li><li>then you should see an option called \"Android SDK Tools (Obsolete)\"<\/li><\/div><p>&nbsp;<\/p><div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/wesoftpress.com\/backup\/wp-content\/uploads\/2021\/05\/Pii3f.png\" style=\"margin-left: 1em; margin-right: 1em;\"><img border=\"0\" data-original-height=\"1446\" data-original-width=\"2026\" height=\"285\" src=\"https:\/\/wesoftpress.com\/backup\/wp-content\/uploads\/2021\/05\/Pii3f-300x214.png\" width=\"400\"><\/a><\/div><br><p><\/p><div itemprop=\"text\">  <li>check it and apply and let the studio download the package <\/li><li>once done run the command <span style=\"background-color: #4c1130; color: white;\">flutter doctor<\/span> and it should now prompt you to run <span style=\"background-color: #4c1130; color: white;\">flutter doctor --android-licenses<\/span>once you run the license command accept all licenses by <span style=\"color: #cc0000;\">hitting y<\/span> and it should solve the problem<\/li>  <div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/wesoftpress.com\/backup\/wp-content\/uploads\/2021\/05\/HVhD5.png\" style=\"margin-left: 1em; margin-right: 1em;\"><img border=\"0\" data-original-height=\"904\" data-original-width=\"1336\" height=\"271\" src=\"https:\/\/wesoftpress.com\/backup\/wp-content\/uploads\/2021\/05\/HVhD5-300x203.png\" width=\"400\"><\/a><\/div><br><div style=\"clear: both; text-align: center;\"><br><\/div><p style=\"text-align: left;\"><\/p>    <\/div><\/div>","meta_description":null,"category_id":7,"user_id":1,"published_at":"2022-11-26 16:26:19","total_views":314,"status":"publish","created_at":"2022-11-26T16:26:19.000000Z","updated_at":"2023-10-09T00:41:04.000000Z"},{"id":33,"title":"Limit the word count in the post title","slug":"limit-the-word-count-in-the-post-title","image":"1691946274.png","description":"Are you looking for Limit the word count in the post title to trim your Post Title Length in WordPress? While there\u2019s probably a plugin for this, we have created a quick code snippet that allows you to use wp_trim_words to trim your text in WordPress.\r\n\r\nWordPress 3.3+ has a core function called&nbsp;<code>wp_trim_words()<\/code>. This function will trim text to a specified number of words and return the result. Adding this snippet to your WordPress loop will let you easily trim the number of words displayed within&nbsp;<code>the_content<\/code>,&nbsp;<code>the_excerpt<\/code>,&nbsp;<code>the_title<\/code>&nbsp;or any other value you pass to this core function.\r\n\r\n<strong>Instructions:<\/strong>\r\n\r\nAll you have to do is add this code to your theme\u2019s PHP file where you want to show the title:\r\n<div class=\"containerx\">\r\n\r\nIf continue sign \"...\" needed at the end of title\r\n<pre style=\"position: relative;\"><code class=\"hljs lang-php\">&lt;?php echo wp_trim_words( get_the_title(), 10, '...' ); ?&gt;\r\n<\/code><\/pre>\r\n<div title=\"Edit &amp; Save To Grepper\"><\/div>\r\nIf continue sign \"...\" not needed at the end of title\r\n<pre style=\"position: relative;\"><code class=\"hljs lang-php\">&lt;?php echo wp_trim_words( get_the_title(), 10 ); ?&gt;<\/code><\/pre>\r\n<\/div>\r\n<h2>Parameters:<\/h2>\r\n<dl>\r\n \t<dt><tt><b>$text<\/b><\/tt><\/dt>\r\n \t<dd>(<i>string<\/i>) (<i>required<\/i>) Text to trim\r\n<dl>\r\n \t<dd>Default:&nbsp;<i>None<\/i><\/dd>\r\n<\/dl>\r\n<\/dd>\r\n<\/dl>\r\n<dl>\r\n \t<dt><tt><b>$num_words<\/b><\/tt><\/dt>\r\n \t<dd>(<i>integer<\/i>) (<i>optional<\/i>) Number of words\r\n<dl>\r\n \t<dd>Default: 55<\/dd>\r\n<\/dl>\r\n<\/dd>\r\n<\/dl>\r\n<dl>\r\n \t<dt><tt><b>$more<\/b><\/tt><\/dt>\r\n \t<dd>(<i>string<\/i>) (<i>optional<\/i>) What to append if&nbsp;<tt>$text<\/tt>&nbsp;needs to be trimmed.<\/dd>\r\n<\/dl>","meta_description":null,"category_id":4,"user_id":1,"published_at":"2022-11-18 05:57:21","total_views":301,"status":"publish","created_at":"2022-11-18T05:57:21.000000Z","updated_at":"2023-10-13T00:16:12.000000Z"},{"id":32,"title":"Remove UI And LI Elements From wp_nav_menu","slug":"remove-ui-and-li-elements-from-wp-nav-menu","image":"1691945671.png","description":"You can remove or change the <b>&lt;ul&gt;<\/b> container and <b>&lt;li&gt;<\/b> that you get by default with wp_nav_menu (<a href=\"https:\/\/codex.wordpress.org\/Function_Reference\/wp_nav_menu\" target=\"_blank\" rel=\"noopener\">codex<\/a>) through parameters, but you can\u2019t remove the <b>&lt;ul&gt;<\/b>&nbsp; and <b>&lt;li&gt;&nbsp;<\/b>elements that wrap each menu item. This is how you can actually remove them:\r\n<pre style=\"position: relative;\"><code class=\"hljs lang-php\">\r\n&lt;?php\r\n$menuParameters = array(\r\n'theme_location' =&gt; 'footer', \/\/ Change Menu name\r\n'container' =&gt; false,\r\n'echo' =&gt; false,\r\n'items_wrap' =&gt; '%3$s',\r\n'depth' =&gt; 0,\r\n);\r\n\r\necho strip_tags(wp_nav_menu( $menuParameters ), '<a>' );\r\n?&gt;\r\n<\/a><\/code><\/pre>","meta_description":null,"category_id":4,"user_id":1,"published_at":"2022-11-17 17:52:34","total_views":331,"status":"publish","created_at":"2022-11-17T17:52:34.000000Z","updated_at":"2023-10-09T02:58:15.000000Z"},{"id":31,"title":"WordPress Post reading time without plugin","slug":"wordpress-post-reading-time-without-plugin","image":"1691945755.png","description":"<p style=\"background: 0px 0px rgb(255, 255, 255); border: 0px; color: #656565; font-family: Roboto, sans-serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;\"><span face=\"&quot;Merriweather Sans&quot;, sans-serif\" style=\"background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #525252; font-size: 18px; outline: 0px; padding: 0px; vertical-align: baseline;\">For Post: Go to<\/span><span face=\"&quot;Merriweather Sans&quot;, sans-serif\" style=\"background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #525252; font-size: 18px; outline: 0px; padding: 0px; vertical-align: baseline;\">&nbsp;<\/span><strong style=\"background: 0px 0px; border: 0px; color: #525252; font-family: &quot;Merriweather Sans&quot;, sans-serif; font-size: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;\"><em style=\"background: 0px 0px; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;\">wp-content\/your-theme\/functions.php<\/em>&nbsp;file<\/strong><span face=\"&quot;Merriweather Sans&quot;, sans-serif\" style=\"background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #525252; font-size: 18px; outline: 0px; padding: 0px; vertical-align: baseline;\">&nbsp;<\/span><span face=\"&quot;Merriweather Sans&quot;, sans-serif\" style=\"background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #525252; font-size: 18px; outline: 0px; padding: 0px; vertical-align: baseline;\">and scroll all the way down.<\/span><\/p><p style=\"background: 0px 0px rgb(255, 255, 255); border: 0px; color: #525252; font-family: &quot;Merriweather Sans&quot;, sans-serif; font-size: 18px; margin: 14px 0px 0px; outline: 0px; padding: 0px; vertical-align: baseline;\">Insert this hook:<\/p>  <pre><code><br>\/*Post Reading Time count *\/<br>if (!function_exists('your_function_name_reading_time')) :<br>  function your_function_name_reading_time($post_id)<br>  {<br>    $content = apply_filters('the_content', get_post_field('post_content', $post_id));<br>    $read_words = esc_attr(get_theme_mod('global_show_min_read_number', '10'));<br>    $decode_content = html_entity_decode($content);<br>    $filter_shortcode = do_shortcode($decode_content);<br>    $strip_tags = wp_strip_all_tags($filter_shortcode, true);<br>    $count = str_word_count($strip_tags);<br>    $word_per_min = (absint($count) \/ $read_words);<br>    $word_per_min = ceil($word_per_min);<br>    if (absint($word_per_min) &gt; 0) {<br>      $word_count_strings = sprintf(_n(<br>        '%s min  ',<br>        '%s min  ',<br>        number_format_i18n($word_per_min),<br>        'isha'<br>      ), number_format_i18n($word_per_min));<br>      if ('post' == get_post_type($post_id)) :<br>        echo esc_html($word_count_strings);<br>      endif;<br>    }<br>    if (absint($word_per_min) == Null) {<br>      echo '1 min';<br>    }<br>  }<br>endif;<br><\/code><\/pre>  <p style=\"background: 0px 0px rgb(255, 255, 255); border: 0px; color: #525252; font-family: &quot;Merriweather Sans&quot;, sans-serif; font-size: 18px; margin: 14px 0px 0px; outline: 0px; padding: 0px; vertical-align: baseline;\">Use this function anywhere in your template:<\/p> <pre><code><span>&lt;?php your_function_name_reading_time( get_the_ID() ); ?&gt;<\/span><\/code><\/pre>","meta_description":null,"category_id":4,"user_id":1,"published_at":"2022-11-17 17:50:58","total_views":249,"status":"publish","created_at":"2022-11-17T17:50:58.000000Z","updated_at":"2023-10-08T00:13:43.000000Z"},{"id":30,"title":"How to Display Publish Dates as \u201cTime Ago\u201d Without Plugin","slug":"how-to-display-publish-dates-as-time-ago-without-plugin","image":"1691945943.png","description":"<span style=\"background-color: white; color: #525252; font-size: 18px;\">For Post: Go to<\/span><span style=\"background-color: white; color: #525252; font-size: 18px;\">&nbsp;<\/span><strong style=\"background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #525252; font-family: 'Merriweather Sans', sans-serif; font-size: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;\"><em style=\"background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;\">wp-content\/your-theme\/functions.php<\/em>&nbsp;file<\/strong><span style=\"background-color: white; color: #525252; font-size: 18px;\">&nbsp;<\/span><span style=\"background-color: white; color: #525252; font-size: 18px;\">and scroll all the way down.<\/span>\r\n<p style=\"background: 0px 0px #ffffff; border: 0px; color: #525252; font-family: 'Merriweather Sans', sans-serif; font-size: 18px; margin: 14px 0px 0px; outline: 0px; padding: 0px; vertical-align: baseline;\">Insert this hook:<\/p>\r\n\r\n<pre><code>\r\n\/\/ Calclute how many time ago posted\r\nfunction my_post_time_ago_function()\r\n{\r\n    return sprintf(esc_html__('%s ago', 'textdomain'), human_time_diff(get_the_time('U'), current_time('timestamp')));\r\n}\r\nadd_filter('the_time', 'my_post_time_ago_function');\r\n<\/code><\/pre>\r\n<p style=\"background: 0px 0px #ffffff; border: 0px; color: #525252; font-family: 'Merriweather Sans', sans-serif; font-size: 18px; margin: 14px 0px 0px; outline: 0px; padding: 0px; vertical-align: baseline;\">Use this function anywhere in your template:<\/p>\r\n\r\n<pre><code>&lt;?php echo my_post_time_ago_function(); ?&gt;<\/code><\/pre>\r\n\r\n<hr style=\"margin: 30px 0;\">\r\n<p style=\"text-align: left;\"><code><span style=\"background: 0px 0px #ffffff; border: 0px; color: #525252; font-size: 18px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; white-space: normal;\">If you want same thing to apply for <b>comment<\/b> dates<\/span><span style=\"background-color: white; color: #525252; font-size: 18px; white-space: normal;\">, create a similar function:<\/span><\/code><\/p>\r\n<p style=\"background: 0px 0px #ffffff; border: 0px; color: #525252; font-family: 'Merriweather Sans', sans-serif; font-size: 18px; margin: 14px 0px 0px; outline: 0px; padding: 0px; vertical-align: baseline;\">Insert this hook:<\/p>\r\n\r\n<pre><code>\r\n\/\/ Calclute how many time ago Commented\r\nfunction my_comment_time_ago_function() {\r\nreturn sprintf( esc_html__( '%s ago', 'textdomain' ), human_time_diff(get_comment_time ( 'U' ), current_time( 'timestamp' ) ) );\r\n}\r\nadd_filter( 'get_comment_date', 'my_comment_time_ago_function' );\r\n<\/code><\/pre>\r\n<p style=\"background: 0px 0px #ffffff; border: 0px; color: #525252; font-family: 'Merriweather Sans', sans-serif; font-size: 18px; margin: 14px 0px 0px; outline: 0px; padding: 0px; vertical-align: baseline;\">Use this function anywhere in your template:<\/p>\r\n\r\n<pre><code>&lt;?php echo my_comment_time_ago_function(); ?&gt;<\/code><\/pre>","meta_description":null,"category_id":4,"user_id":1,"published_at":"2022-11-17 17:50:02","total_views":263,"status":"publish","created_at":"2022-11-17T17:50:02.000000Z","updated_at":"2023-10-08T11:51:42.000000Z"}],"first_page_url":"https:\/\/backend.wesoftpress.com\/api\/blog\/category\/ununtu?page=1","from":1,"last_page":2,"last_page_url":"https:\/\/backend.wesoftpress.com\/api\/blog\/category\/ununtu?page=2","links":[{"url":null,"label":"&laquo; Previous","active":false},{"url":"https:\/\/backend.wesoftpress.com\/api\/blog\/category\/ununtu?page=1","label":"1","active":true},{"url":"https:\/\/backend.wesoftpress.com\/api\/blog\/category\/ununtu?page=2","label":"2","active":false},{"url":"https:\/\/backend.wesoftpress.com\/api\/blog\/category\/ununtu?page=2","label":"Next &raquo;","active":false}],"next_page_url":"https:\/\/backend.wesoftpress.com\/api\/blog\/category\/ununtu?page=2","path":"https:\/\/backend.wesoftpress.com\/api\/blog\/category\/ununtu","per_page":12,"prev_page_url":null,"to":12,"total":17},"categories":[{"id":3,"name":"Ununtu","slug":"ununtu","description":null,"created_at":"2022-11-15T17:03:42.000000Z","updated_at":"2022-11-15T17:03:42.000000Z"},{"id":4,"name":"WordPress","slug":"wordpress","description":null,"created_at":"2022-11-15T17:07:35.000000Z","updated_at":"2022-11-15T17:07:35.000000Z"},{"id":5,"name":"Problem Solving","slug":"problem-solving","description":null,"created_at":"2022-11-15T18:03:22.000000Z","updated_at":"2022-11-15T18:03:22.000000Z"},{"id":7,"name":"Flutter","slug":"flutter","description":null,"created_at":"2022-11-26T16:25:35.000000Z","updated_at":"2022-11-26T16:25:35.000000Z"}],"tags":[{"id":1,"name":"tag1","slug":"tag1","description":null,"created_at":"2022-11-07T07:45:36.000000Z","updated_at":"2022-11-07T07:45:36.000000Z"},{"id":2,"name":"tag2","slug":"tag2","description":null,"created_at":"2022-11-07T07:45:39.000000Z","updated_at":"2022-11-07T07:45:39.000000Z"}]}