<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>WordPress on Infinite Script</title><link>https://www.infinitescript.com/tags/wordpress/</link><description>Recent content in WordPress on Infinite Script</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 20 Jan 2024 07:45:45 +0800</lastBuildDate><atom:link href="https://www.infinitescript.com/tags/wordpress/index.xml" rel="self" type="application/rss+xml"/><item><title>Migrating from WordPress to Hugo</title><link>https://www.infinitescript.com/2024/01/migrate-from-wordpress-to-hugo/</link><pubDate>Sat, 20 Jan 2024 07:45:45 +0800</pubDate><guid>https://www.infinitescript.com/2024/01/migrate-from-wordpress-to-hugo/</guid><description>&lt;p&gt;I recently switched from WordPress to Hugo. This post outlines the reasons behind my migration and provides a step-by-step guide on how to make the transition.&lt;/p&gt;&#10;&lt;h2 id="rethinking-why-use-wordpress"&gt;Rethinking Why Use WordPress&lt;/h2&gt;&#10;&lt;p&gt;I began using WordPress in 2009 when static site generators were not prevalent, and WordPress was the go-to CMS for nearly everyone.&#10;However, since my blog had infrequent updates but high readership, I started reconsidering the use of WordPress.&#10;&lt;a href="https://www.infinitescript.com/2019/06/accelerate-wordpress-with-cdn-and-cache-servers/"&gt;Five years ago&lt;/a&gt;, I decided to convert the WordPress site into static HTML and uploaded it to a CDN to accelerate access speed for users in mainland China.&lt;/p&gt;</description></item><item><title>Accelerate WordPress with CDN and Cache Servers</title><link>https://www.infinitescript.com/2019/06/accelerate-wordpress-with-cdn-and-cache-servers/</link><pubDate>Sat, 01 Jun 2019 06:50:36 +0000</pubDate><guid>https://www.infinitescript.com/2019/06/accelerate-wordpress-with-cdn-and-cache-servers/</guid><description>&lt;p&gt;&#10;&#10;&lt;a href="https://www.infinitescript.com/2019/06/InfiniteScript-Architecture.webp" data-fancybox data-caption="InfiniteScript-Architecture"&gt;&#10; &lt;img src="https://www.infinitescript.com/2019/06/InfiniteScript-Architecture.webp" width="2500" height="800" alt="InfiniteScript-Architecture" loading="lazy"&gt;&#10;&lt;/a&gt;&#10;&#10;&#10;&lt;/p&gt;&#10;&lt;p&gt;It has been a long time since I last wrote a blog post. In the past few days, I updated the architecture of Infinite Script to accelerate the speed for Chinese users. In this article, I share the new architecture of our website with you, illustrated in the figure above.&lt;/p&gt;&#10;&lt;h2 id="optimizing-a-cdn-for-static-content-delivery"&gt;Optimizing a CDN for Static Content Delivery&lt;/h2&gt;&#10;&lt;p&gt;Static content does not change over a period of time. If it does change, the changes are predictable. Static content includes images, CSS sheets, JavaScripts, and PDF files. Because of this, CDNs can cache a copy of the content at their edge servers. They can then serve it whenever a client requests it. CDNs are best at optimizing the delivery of static content from edge servers to users. Therefore, we use the CDN from &lt;a href="https://alibabacloud.com"&gt;Alibaba Cloud&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>WordPress $ is not defined</title><link>https://www.infinitescript.com/2014/08/wordpress-is-not-defined-even-if-jquery-is-loaded/</link><pubDate>Thu, 21 Aug 2014 04:29:54 +0000</pubDate><guid>https://www.infinitescript.com/2014/08/wordpress-is-not-defined-even-if-jquery-is-loaded/</guid><description>&lt;p&gt;If you copy a normal jQuery snippet into a WordPress theme or plugin, sooner or later you hit &lt;code&gt;Uncaught ReferenceError: $ is not defined&lt;/code&gt;. The confusing part is that jQuery itself &lt;em&gt;is&lt;/em&gt; loaded; your other jQuery code may even be working. So why does &lt;code&gt;$&lt;/code&gt; blow up?&lt;/p&gt;&#10;&lt;h2 id="why-it-happens"&gt;Why It Happens&lt;/h2&gt;&#10;&lt;p&gt;WordPress ships its own copy of jQuery and loads it in &lt;strong&gt;no-conflict mode&lt;/strong&gt;. On startup it effectively runs:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-js" data-lang="js"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;jQuery&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;noConflict&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;noConflict()&lt;/code&gt; tells jQuery to give back control of the global &lt;code&gt;$&lt;/code&gt;. After it runs, &lt;code&gt;jQuery&lt;/code&gt; still points to the library, but &lt;code&gt;$&lt;/code&gt; no longer does; it is left free for some other library to claim.&lt;/p&gt;</description></item><item><title>HFUT Portals</title><link>https://www.infinitescript.com/project/hfut-portals/</link><pubDate>Fri, 01 Mar 2013 12:00:00 +0000</pubDate><guid>https://www.infinitescript.com/project/hfut-portals/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;&#10;&lt;p&gt;As an undergraduate at Hefei University of Technology (HFUT), I designed and built official websites for several university departments, listed below with the period each stayed in service.&#10;Each site runs on a custom WordPress theme, which let department staff publish notices, news, and documents on their own through the familiar dashboard.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;a href="https://web.archive.org/web/20150924182207/http://rjxy.hfut.edu.cn/"&gt;School of Software&lt;/a&gt;&lt;/strong&gt; (软件学院): March 2013 to March 2018&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;a href="https://web.archive.org/web/20150922071240/http://dxsxlgh.hfut.edu.cn/welcome/"&gt;Psychological Care Center&lt;/a&gt;&lt;/strong&gt; (大学生心理关爱网): from November 2013&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;a href="https://web.archive.org/web/20170525165515/http://jwbjxb.hfut.edu.cn/"&gt;Office of Academic Affairs&lt;/a&gt;&lt;/strong&gt; (教学办公室): August 2014 to October 2020&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;a href="https://web.archive.org/web/20220501134934/http://rwyszjyzx.hfut.edu.cn/"&gt;Center for Humanities and Quality Education&lt;/a&gt;&lt;/strong&gt; (人文与素质教育中心): July 2015 to May 2022&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&lt;a href="https://web.archive.org/web/20211122111355/http://jiwei.hfut.edu.cn/"&gt;Discipline Inspection and Supervision Office&lt;/a&gt;&lt;/strong&gt; (纪委办公室、监察处): August 2014 to November 2021&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The Psychological Care Center was &lt;a href="https://news.hfut.edu.cn/info/1011/15603.htm"&gt;launched&lt;/a&gt; after nearly a year of planning.&#10;It combines five sub-sites for students, parents, peer counselors, faculty, and mental health professionals, and was entered in the 6th National Top 100 University Websites (第六届全国高校百佳网站) contest run by the Ministry of Education&amp;rsquo;s China University Students Online.&lt;/p&gt;</description></item><item><title>Generate a Random File Name when Uploading Files in WordPress</title><link>https://www.infinitescript.com/2013/02/rename-files-during-upload-within-wordpress-backend/</link><pubDate>Mon, 18 Feb 2013 10:00:37 +0000</pubDate><guid>https://www.infinitescript.com/2013/02/rename-files-during-upload-within-wordpress-backend/</guid><description>&lt;p&gt;The passage is telling you how to rename the file name automatically by WordPress (without using any plugins).&lt;/p&gt;&#10;&lt;h2 id="a-word-of-warning"&gt;A Word of Warning&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;Warning&lt;/strong&gt;: To apply this hack, you&amp;rsquo;ll have to edit one of WordPress&amp;rsquo;s core files. Keep in mind that it is never recommended. This hack should be redone if you upgrade WordPress.&lt;/p&gt;&#10;&lt;h2 id="editing-the-upload-handler"&gt;Editing the Upload Handler&lt;/h2&gt;&#10;&lt;p&gt;Open the wp-admin/includes/files.php file, and go to line 324 (approximately here). You&amp;rsquo;ll see the following:&lt;/p&gt;</description></item></channel></rss>