<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/assets/rss.xsl" type="text/xsl"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
>
<channel>
	<title>Sacha Chua - category - wordpress</title>
	<atom:link href="https://sachachua.com/blog/category/wordpress/feed/index.xml" rel="self" type="application/rss+xml" />
	<atom:link href="https://sachachua.com/blog/category/wordpress" rel="alternate" type="text/html" />
	<link>https://sachachua.com/blog/category/wordpress/feed/index.xml</link>
	<description>Emacs, sketches, and life</description>
	<lastBuildDate>Mon, 27 Apr 2026 11:29:30 GMT</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>daily</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>11ty</generator>
  <item>
		<title>Filtering WordPress posts after a certain date</title>
		<link>https://sachachua.com/blog/2016/12/filtering-wordpress-posts-after-a-certain-date/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Thu, 29 Dec 2016 18:51:00 GMT</pubDate>
    <category>wordpress</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=28863</guid>
		<description><![CDATA[<p>I wanted to make it easy to link people to a <a href="http://direct.sachachua.com/blog/category/weekly/?order=asc&amp;after=2016-02-22&amp;bulk=1">chronological view of my weekly reviews after becoming a parent</a>, so I added this code to the functions.php in my custom WordPress theme.</p>
<div class="org-src-container">
<pre class="src src-php"><span class="org-keyword">function</span> <span class="org-function-name">sacha_tweak_query</span>() {
    <span class="org-keyword">if</span> (<span class="org-default">$</span><span class="org-variable-name">_REQUEST</span>[<span class="org-string">'after'</span>] &amp;&amp; preg_match(<span class="org-string">'/^[-0-9]+$/'</span>, <span class="org-default">$</span><span class="org-variable-name">_REQUEST</span>[<span class="org-string">'after'</span>]))  { 
        set_query_var(<span class="org-string">'date_query'</span>, <span class="org-keyword">array</span>(<span class="org-string">'column'</span> =&gt; <span class="org-string">'post_date'</span>, <span class="org-string">'after'</span> =&gt; <span class="org-default">$</span><span class="org-variable-name">_REQUEST</span>[<span class="org-string">'after'</span>], <span class="org-string">'inclusive'</span> =&gt; <span class="org-constant">true</span>));
    }
    <span class="org-keyword">if</span> (<span class="org-default">$</span><span class="org-variable-name">_REQUEST</span>[<span class="org-string">'bulk'</span>]) {
        set_query_var(<span class="org-string">'posts_per_page'</span>, -1);
    }
}

add_action(<span class="org-string">'pre_get_posts'</span>, <span class="org-string">'sacha_tweak_query'</span>);
</pre>
</div>
<p>It checks for HTTP query variables of the form after=2016-02-22 and bulk=1. If it sees an &#8220;after&#8221; filter, it updates the query to show only posts after that date. Bulk gets you all the entries on one page. (… Please use this wisely. =) )</p>
<p>Using the <code>pre_get_posts</code> action lets me make the functionality available across all the archive pages (tag, category, date) without adding special code to each of them. Neat!</p>

<p>You can <a href="https://sachachua.com/blog/2016/12/filtering-wordpress-posts-after-a-certain-date/#comment">view 1 comment</a> or <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2016%2F12%2Ffiltering-wordpress-posts-after-a-certain-date%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item><item>
		<title>Fixed paragraph breaks in WordPress, no more wall of text</title>
		<link>https://sachachua.com/blog/2016/12/fixed-paragraph-breaks-in-wordpress-no-more-wall-of-text/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Thu, 29 Dec 2016 18:48:00 GMT</pubDate>
    <category>blogging</category>
<category>development</category>
<category>wordpress</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=28862</guid>
		<description><![CDATA[<p>While trying out the <a href="https://sachachua.com/blog/2016/12/filtering-wordpress-posts-after-a-certain-date/">&#8220;after&#8221; filter I just added to my blog</a>, I noticed that my paragraph breaks were missing. I hadn't noticed it for a while because I've been building up my weekly and monthly reviews from sketches instead of blog posts. How embarrassing!</p>
<p>(Then A- woke up and it was time for lunch, so I was a bit frazzled. But W- stepped in and took care of her, hooray!)</p>
<p>I saw the paragraph breaks in WordPress' visual editor, but not the exported HTML, which just kept whitespace in between the paragraphs instead of breaking them up with tags. It happened even when I created a new post through the web interface, so it wasn't org2blog's fault.</p>
<p>I checked if the paragraph issue happened on a new install. It didn't.</p>
<p>I checked if the paragraph issue happened with all the plugins deactivated. It didn't. Aha! (Note to self: I really should set up a dev environment again…)</p>
<p>I turned the plugins on one by one, and I narrowed it down to the NextGen Gallery plugin. It worked after I updated that.</p>
<p>Anyway, things should be readable again. Hooray!</p>

<p>You can <a href="https://sachachua.com/blog/2016/12/fixed-paragraph-breaks-in-wordpress-no-more-wall-of-text/#comment">view 7 comments</a> or <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2016%2F12%2Ffixed-paragraph-breaks-in-wordpress-no-more-wall-of-text%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item><item>
		<title>Visualizing the internal citation network of my blog</title>
		<link>https://sachachua.com/blog/2015/01/visualizing-internal-citation-network-blog/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Fri, 23 Jan 2015 13:00:42 GMT</pubDate>
    <category>visualization</category>
<category>pkm</category>
<category>visual</category>
<category>wordpress</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=27667</guid>
		<description><![CDATA[<p>I&#8217;m curious about the internal citation of my blog. Which thoughts have been developed over a long chain of posts? Which posts do I often link to? Where are there big jumps in time? Where have I combined threads?</p>
<p><a href="https://sachachua.com/blog/wp-content/uploads/2014/12/2014-12-03-Internal-citation-network.png"><img loading="lazy" class="alignnone wp-image-27668 size-medium" src="https://sachachua.com/blog/wp-content/uploads/2014/12/2014-12-03-Internal-citation-network-640x266.png" alt="2014-12-03 Internal citation network" width="640" height="266" srcset="https://sachachua.com/blog/wp-content/uploads/2014/12/2014-12-03-Internal-citation-network-640x266.png 640w, https://sachachua.com/blog/wp-content/uploads/2014/12/2014-12-03-Internal-citation-network-280x116.png 280w, https://sachachua.com/blog/wp-content/uploads/2014/12/2014-12-03-Internal-citation-network.png 1413w" sizes="(max-width: 640px) 100vw, 640px"></a></p>
<p>I&#8217;ll probably need to build my own data extractor so that it can:</p>
<ul>
<li>ignore weekly and monthly reviews, since I link to everything in those,</li>
<li>reconcile short and long permalinks, redirection, and sneak previews,</li>
<li>and maybe even index my sketches and look at follow-ups</li>
</ul>
<p>and I&#8217;ll probably want to create something that I could eventually plot as an SVG or imagemap using Graphviz, or maybe analyze using Gephi.</p>
<p>It would be super-interesting to create some kind of output that I could fold into my blog outline or into individual posts. I would need a static dump for that one, I think.</p>
<p>How would I build something like this? One time, I used Ruby to <a href="https://sachachua.com/blog/2011/12/blog-analysis-2011-173363-words-far-also-rails-console-work-wordpress/">analyze the text of my blog</a>. That might work. I might be able to pull out all the link hrefs, do lookups&#8230;</p>
<p>As of Dec 3, 2014, there are 87 posts in 2014 that link to previous posts, out of 259 non-review posts (so roughly 34%). I used this SQL query to get that:</p>
<p>SELECT post_title FROM wp_posts WHERE post_content LIKE &#8216;%&lt;a href=&#8221;https://sachachua.com/blog/20%&#8217; AND post_date &gt;= &#8216;2014-01-01&#8217; AND post_title NOT LIKE &#8216;%review:%&#8217; AND post_state=&#8217;publish&#8217;;</p>
<p>Hmm. I might even be able to do some preliminary explorations with Emacs and text processing instead of writing a script to analyze this, if I focus on 2014 and ignore the special cases (short permalinks, redirection, and sneak previews), just to see what the data looks like. Rough technical notes:</p>
<pre>perl -i -p -e s/href/\nhref/gi 2014-manip.html
grep http://sachachua.com/blog/20 2013-manip.html &gt; list-2013
perl -i -p -e "s/(&lt;\/a&gt;(&lt;\/h2&gt;)?).*/$1/gi" list-2013
</pre>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span class="org-keyword">defun</span> <span class="org-function-name">sacha/misc-clean-up-reviews</span> ()
  (interactive)
  (<span class="org-keyword">while</span> (re-search-forward <span class="org-string">"</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">Monthly</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">Weekly</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string"> review: .*&lt;/h2&gt;"</span> nil t)
    (<span class="org-keyword">let</span> ((start (line-beginning-position)))
      (re-search-forward <span class="org-string">"&lt;/h2&gt;"</span>)
      (delete-region start (line-beginning-position))
      (goto-char (line-beginning-position)))))

(<span class="org-keyword">defun</span> <span class="org-function-name">sacha/org-tabulate-links</span> ()
  (interactive)
  (goto-char (point-min))
  (<span class="org-keyword">let</span> (main-link edges nodes)
    (<span class="org-keyword">while</span> (not (eobp))
      (<span class="org-keyword">if</span> (looking-at <span class="org-string">"^href=\"</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">.*?</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">\".*?&lt;/a&gt;&lt;/h2&gt;"</span>)
          <span class="org-comment-delimiter">;; </span><span class="org-comment">Main entry</span>
          (<span class="org-keyword">progn</span>
            (setq nodes (cons (match-string 1) nodes))
            (setq main-link (match-string 1)))
        (<span class="org-keyword">if</span> (looking-at <span class="org-string">"^href=\"</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">.*?</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">\""</span>)
            (setq edges (cons (concat 
                               main-link  <span class="org-comment-delimiter">;; </span><span class="org-comment">from</span>
                               <span class="org-string">"\t"</span>
                               (match-string 1)   <span class="org-comment-delimiter">;; </span><span class="org-comment">to </span>
                               ) edges))))
      (forward-line 1))
    (kill-new (mapconcat 'identity edges <span class="org-string">"\n"</span>))))
</pre>
</div>
<p>Ooooh. Pretty. Gephi visualization of the edge list formed by links, using the Yifan Hu layout. That big thread in the middle, that&#8217;s the one about taskmasters and choice and productivity, which is indeed the core theme running through this year of the experiment. The cluster on the right is a year in review. We see lots of little links too.</p>
<div id="attachment_27669" style="width: 592px" class="wp-caption alignnone"><a href="https://sachachua.com/blog/wp-content/uploads/2014/12/2014-12-03-20_23_52-Gephi-0.8.2-Project-0.png"><img aria-describedby="caption-attachment-27669" loading="lazy" class="wp-image-27669 size-full" src="https://sachachua.com/blog/wp-content/uploads/2014/12/2014-12-03-20_23_52-Gephi-0.8.2-Project-0.png" alt="Internal links for entries posted in 2014" width="582" height="558" srcset="https://sachachua.com/blog/wp-content/uploads/2014/12/2014-12-03-20_23_52-Gephi-0.8.2-Project-0.png 582w, https://sachachua.com/blog/wp-content/uploads/2014/12/2014-12-03-20_23_52-Gephi-0.8.2-Project-0-208x200.png 208w" sizes="(max-width: 582px) 100vw, 582px"></a><p id="caption-attachment-27669" class="wp-caption-text">Internal links for entries posted in 2014</p></div>
<p>Now I&#8217;m curious about what happens when we add the posts and links from 2013 and 2012, too. I&#8217;ve colour-coded this by year, with It ties together posts on sketchnoting, blogging, choice, learning, writing, plans&#8230; Neat.</p>
<p><a href="https://sachachua.com/blog/wp-content/uploads/2014/12/blog-graph1.png"><img loading="lazy" class="alignnone wp-image-27672 size-medium" src="https://sachachua.com/blog/wp-content/uploads/2014/12/blog-graph1-640x640.png" alt="blog-graph" width="640" height="640" srcset="https://sachachua.com/blog/wp-content/uploads/2014/12/blog-graph1-640x640.png 640w, https://sachachua.com/blog/wp-content/uploads/2014/12/blog-graph1-200x200.png 200w, https://sachachua.com/blog/wp-content/uploads/2014/12/blog-graph1.png 1024w" sizes="(max-width: 640px) 100vw, 640px"></a></p>
<p>&nbsp;</p>
<p>What does this say? It says that even though I write about lots of different things, there are connections between the different topics, and the biggest tangle in the middle has more than 320 nodes. I have lots of blog posts that build on an idea for three or four posts, sometimes spanning several years, even if I don&#8217;t think about it in advance. There are 90 such clumps, and it might be good to revisit some of these 2- and 3-post chains to see if I can link them up even further.</p>
<p>Also, it could be interesting to do this analysis with tags, not just year. Hmm&#8230; Also, I should dust off my data structures and algorithms, and make my own connected-component analyzer so that I can get a list of the clumps of topics. Good ideas to save for another day!</p>

<p>You can <a href="https://sachachua.com/blog/2015/01/visualizing-internal-citation-network-blog/#comment">view 2 comments</a> or <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2015%2F01%2Fvisualizing-internal-citation-network-blog%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item><item>
		<title>Thoughts in context: Connecting posts to my blog post index</title>
		<link>https://sachachua.com/blog/2015/01/thoughts-context-connecting-posts-blog-post-index/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Fri, 16 Jan 2015 13:00:00 GMT</pubDate>
    <category>pkm</category>
<category>wordpress</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=27682</guid>
		<description><![CDATA[<p>I&#8217;ve been thinking about how to improve the inter-post organization of my blog so that I can write more effectively and so that other people can find things faster. I often link to posts I&#8217;ve previously written, but I rarely update old posts to link forward to other related posts. There are quite a few internal linking plugins for WordPress, but they seem more slanted towards SEO and keywords than I&#8217;d like.</p>
<p>I wanted to come up with another approach that could take advantage of the big outline of my blog posts at <a href="https://sachachua.com/index">https://sachachua.com/index</a> that I update every month. I&#8217;ve found this to be pretty handy for organizing things into finer categories instead of going back and updating lots of posts in WordPress. I can search this easily on my computer by using <code>helm-swoop</code>, and I can move things around using Org Mode.</p>
<p>It got me thinking: Is there a way I can make it easier to <b>connect posts to the index</b> so that if people find an old post useful, they can explore related posts?</p>
<p>So here&#8217;s what I came up with: a small <strong>See in index </strong>link at the end of the post.</p>
<div id="attachment_27683" style="width: 650px" class="wp-caption alignnone"><a href="https://sachachua.com/blog/wp-content/uploads/2015/01/2014-12-08-16_45_13-sacha-chua-__-living-an-awesome-life-Page-2-of-1159-learn-share-scale.png"><img aria-describedby="caption-attachment-27683" loading="lazy" class="wp-image-27683 size-medium" src="https://sachachua.com/blog/wp-content/uploads/2015/01/2014-12-08-16_45_13-sacha-chua-__-living-an-awesome-life-Page-2-of-1159-learn-share-scale-640x167.png" alt="2014-12-08 16_45_13-sacha chua __ living an awesome life - Page 2 of 1159 - learn - share - scale" width="640" height="167" srcset="https://sachachua.com/blog/wp-content/uploads/2015/01/2014-12-08-16_45_13-sacha-chua-__-living-an-awesome-life-Page-2-of-1159-learn-share-scale-640x167.png 640w, https://sachachua.com/blog/wp-content/uploads/2015/01/2014-12-08-16_45_13-sacha-chua-__-living-an-awesome-life-Page-2-of-1159-learn-share-scale-280x73.png 280w, https://sachachua.com/blog/wp-content/uploads/2015/01/2014-12-08-16_45_13-sacha-chua-__-living-an-awesome-life-Page-2-of-1159-learn-share-scale.png 677w" sizes="(max-width: 640px) 100vw, 640px"></a><p id="caption-attachment-27683" class="wp-caption-text">Index link on old posts</p></div>
<p>Not all the posts are indexed yet, but for those that are, clicking on that link will open up the blog index and scroll it to the right post, highlighting the match, so people can see what else is in the neighbourhood.</p>
<div id="attachment_27684" style="width: 650px" class="wp-caption alignnone"><a href="https://sachachua.com/blog/wp-content/uploads/2015/01/2014-12-08-16_45_33-sacha-chua-__-blog.png"><img aria-describedby="caption-attachment-27684" loading="lazy" class="wp-image-27684 size-medium" src="https://sachachua.com/blog/wp-content/uploads/2015/01/2014-12-08-16_45_33-sacha-chua-__-blog-640x202.png" alt="2014-12-08 16_45_33-sacha chua __ blog" width="640" height="202" srcset="https://sachachua.com/blog/wp-content/uploads/2015/01/2014-12-08-16_45_33-sacha-chua-__-blog-640x202.png 640w, https://sachachua.com/blog/wp-content/uploads/2015/01/2014-12-08-16_45_33-sacha-chua-__-blog-280x88.png 280w, https://sachachua.com/blog/wp-content/uploads/2015/01/2014-12-08-16_45_33-sacha-chua-__-blog.png 699w" sizes="(max-width: 640px) 100vw, 640px"></a><p id="caption-attachment-27684" class="wp-caption-text">Matching link</p></div>
<p>To make this work, I added the following HTML code to my blog index:</p>
<div class="org-src-container">
<pre class="src src-web">&lt;script type="text/javascript"&gt;
// from http://www.jquerybyexample.net/2012/06/get-url-parameters-using-jquery.html
<span class="org-web-mode-keyword">function</span> <span class="org-web-mode-function-name">getURLParameter</span>(sParam)
{
    <span class="org-web-mode-keyword">var</span> <span class="org-web-mode-variable-name">sPageURL</span> = window.location.search.substring(1);
    <span class="org-web-mode-keyword">var</span> <span class="org-web-mode-variable-name">sURLVariables</span> = sPageURL.split('&amp;');
    <span class="org-web-mode-keyword">for</span> (<span class="org-web-mode-keyword">var</span> <span class="org-web-mode-variable-name">i</span> = 0; i &lt; sURLVariables.length; i++)
    {
        <span class="org-web-mode-keyword">var</span> <span class="org-web-mode-variable-name">sParameterName</span> = sURLVariables[i].split('=');
        <span class="org-web-mode-keyword">if</span> (sParameterName[0] == sParam)
        {
            <span class="org-web-mode-keyword">return</span> sParameterName[1];
        }
    }
}

<span class="org-web-mode-keyword">function</span> <span class="org-web-mode-function-name">sachaScrollToBlog</span>() {
  <span class="org-web-mode-keyword">if</span> (getURLParameter("url")) {
    <span class="org-web-mode-keyword">var</span> <span class="org-web-mode-variable-name">link</span> = $('a[href="' + getURLParameter("url") + '"]');
    <span class="org-web-mode-keyword">if</span> (link.length &gt; 0) { 
      $('html, body').scrollTop(link.offset().top - 100);
      link.addClass("highlighted");
    } <span class="org-web-mode-keyword">else</span> {
      alert("Sorry, could not find post in index.");
    }
  }
}

$(document).ready(sachaScrollToBlog);
&lt;/script&gt;
&lt;style type="text/css"&gt;
<span class="org-web-mode-css-selector">a</span>.<span class="org-web-mode-css-selector">highlighted</span> { <span class="org-web-mode-css-property-name">background-color</span>: yellow; <span class="org-web-mode-css-property-name">padding</span>: 10px }
&lt;/style&gt;
</pre>
</div>
<p>Then I added this to the <code>post.php</code> and <code>single.php</code> for my WordPress theme:</p>
<div class="org-src-container">
<pre class="src src-web">&lt;?php
if (get_the_date('Y') &gt;= '2008' &amp;&amp; get_the_date('Y-m') &lt; date('Y-m', time() - 60 * 60 * 24 * 7 * 2)) {
  print '&lt;a href="http://pages.sachachua.com/sharing/blog.html?url=' . get_permalink() . '"&gt;See in index&lt;/a&gt;';
}
?&gt;
</pre>
</div>
<p>The date condition is there to minimize frustration. I&#8217;ve indexed posts published 2008 or later, and I usually post an updated index within the first half of the month. I might spend some time indexing older posts; if I do, I&#8217;ll update the starting position.</p>
<p>It would be interesting to refine my writing workflow so that my blog index is always up to date. That way, even new posts will have this magic indexing power. It might be difficult to get that squared up with my scheduling, though, since I sometimes write a few weeks in advance. Anyway, neat, huh? This should make the archives marginally more useful. =) Good for me too!</p>

<p>You can <a href="https://sachachua.com/blog/2015/01/thoughts-context-connecting-posts-blog-post-index/#comment">view 8 comments</a> or <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2015%2F01%2Fthoughts-context-connecting-posts-blog-post-index%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item><item>
		<title>Publishing WordPress thumbnail images using Emacs and Org2Blog</title>
		<link>https://sachachua.com/blog/2014/10/publishing-wordpress-thumbnail-images-using-emacs-org2blog/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Fri, 31 Oct 2014 12:00:00 GMT</pubDate>
    <category>blogging</category>
<category>emacs</category>
<category>org</category>
<category>wordpress</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=27573</guid>
		<description><![CDATA[<p>I often include large images in my blog posts since I use sketches as another way to think out loud. I'd gotten used to using the WordPress web interface to drag and drop them into the relevant section of the page. I write most text in Emacs/Org Mode/Org2Blog because of the better outlining and writing tools, and then I used <code>sacha/org-copy-region-as-html</code> (which you can grab from my <a href="https://sachachua.com/dotemacs">Emacs configuration</a>) to copy the HTML markup and paste it into WordPress. Of course, I use Emacs for source-code heavy posts that make the most of its syntax formatting support.</p>
<p>Someone asked me recently about how to post and update blog posts with images through Org2blog, and if I had any recommendations for workflow. I'd dropped Windows Live Writer since it was flaking out on me and the WordPress web interface had improved a lot, but before recommending just using WordPress to add images, I was curious about whether I could improve my blogging workflow by digging into Org Mode and Org2Blog further.</p>
<p>It turns out (like it usually does in the Emacs world) that someone had already solved the problem, and I just didn't have the updated version. Although the upstream version of <a href="https://github.com/punchagan/org2blog">Org2Blog</a> didn't yet have the thumbnail code, searching for &#8220;org2blog wordpress thumbnail&#8221; led me to cpbotha's <a href="https://github.com/punchagan/org2blog/issues/158">Github issue</a> and <a href="https://github.com/punchagan/org2blog/pull/159">pull request</a>. Punchagan's version had some changes that were a little bit ahead of cpbotha's, so I dusted off <a href="https://github.com/sachac/org2blog">my ancient org2blog repository</a>, cloned it onto my computer, and issued the following commands:</p>
<pre class="example">git remote add upstream https://github.com/punchagan/org2blog
git pull upstream master
git remote add cpbotha https://github.com/cpbotha/org2blog.git
git pull cpbotha image-thumbnail
</pre>
<p>and tested it out on a blog post I'd already drafted in Org. It took me a little while to remember that the file URLs didn't like <code>~</code>, so I specified a relative path to the image instead. But then it all worked, yay! A quick <code>git push</code> later, and my Github repository was up to date again.</p>
<p>So now I'm back to running a Git version of <code>org2blog</code> instead of the one that I had installed using the built-in packaging system. The way I make it work is that I have this near the beginning of my Emacs configuration:</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">This sets up the load path so that we can override it</span>
(package-initialize nil)
<span class="org-comment-delimiter">;; </span><span class="org-comment">Override the packages with the git version of Org and other packages</span>
(add-to-list 'load-path <span class="org-string">"~/elisp/org-mode/lisp"</span>)
(add-to-list 'load-path <span class="org-string">"~/elisp/org-mode/contrib/lisp"</span>)
(add-to-list 'load-path <span class="org-string">"~/code/org2blog"</span>)
(add-to-list 'load-path <span class="org-string">"~/Dropbox/2014/presentations/org-reveal"</span>)
<span class="org-comment-delimiter">;; </span><span class="org-comment">Load the rest of the packages</span>
(package-initialize t)
(setq package-enable-at-startup nil)
</pre>
</div>
<p>This allows me to mostly use the packages and to satisfy dependencies, but override some of the load paths as needed.</p>
<p>Hope that helps someone else!</p>

<p>You can <a href="https://sachachua.com/blog/2014/10/publishing-wordpress-thumbnail-images-using-emacs-org2blog/#comment">view 6 comments</a> or <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2014%2F10%2Fpublishing-wordpress-thumbnail-images-using-emacs-org2blog%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item><item>
		<title>More notes on managing a large blog archive: 17 things I do to handle 10+ years of blog posts</title>
		<link>https://sachachua.com/blog/2014/03/notes-managing-large-blog-archive/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Tue, 04 Mar 2014 13:00:41 GMT</pubDate>
    <category>pkm</category>
<category>blogging</category>
<category>wordpress</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=26972</guid>
		<description><![CDATA[<p>I've been thinking a lot about how to manage a large archive to encourage discovery and serendipity, and to make it easier to fish out articles so that I can send them to people. I started in 2001-ish and have more than 6,500 posts. There's not a lot of information on how to manage a large archive. Most blogging-related advice focuses on helping people get started and get going. Few people have a large personal archive yet. I love coming across other bloggers who have been at this for more than ten years, because information architecture is fascinating. Here's what I do, in case it gives you any ideas.</p>
<ol>
<li><strong> I set up Google Chrome quick searches</strong> for my blog, categories, and tags. This means I can quickly dig up blog posts if I remember roughly where they are. (Gear &gt; Settings &gt; Search &gt; Manage Search Engines):
<ul>
<li>Blog (b): https://www.google.ca/search?q=site%3Asachachua.com+%s</li>
<li>Blog category (bc): https://sachachua.com/blog/category/%s</li>
<li>Blog tag (bt): https://sachachua.com/blog/tag/%s</li>
</ul>
</li>
<li><strong>I create pages with additional notes and lists of content.</strong> I use either <a style="font-size: 14px; line-height: 1.5em;" href="http://wordpress.org/plugins/display-posts-shortcode/">Display Posts Shortcode</a> or WP Views, depending on what I need. See the <a style="font-size: 14px; line-height: 1.5em;" href="https://sachachua.com/blog/emacs/">Emacs</a> page as an example.</li>
<li><strong>I've started using <a href="http://wordpress.org/plugins/organize-series/">Organize Series</a> to set up trails through my content.</strong> It's more convenient than manually defining links, and it allows people to page through the posts in order too.<strong> </strong><a href="https://sachachua.com/blog/2014/02/wordpress-make-sequence-posts-easier-navigate-organize-series/">Read my notes to find examples.</a> I'm also working on maps, outlines, and overviews.</li>
<li><strong>I've also started packaging resources into PDFs and e-books.</strong> It makes sense to organize things in a more convenient form.<b><br>
</b></li>
<li><strong>I converted all the categories with fewer than ten entries to tags</strong>. Categories can get unwieldy when you create them organically, so I use categories for main topics and tags for other keywords that might graduate to become categories someday. <strike>I think I used <a href="http://wordpress.org/plugins/wpcat2tag-importer/">Categories to Tags Converter</a> or <a href="http://wordpress.org/plugins/taxonomy-converter/">Taxonomy Converter</a> for this.</strike> Hah! Similar Posts reminded me that I used <a href="https://sachachua.com/blog/2013/09/reorganizing-wordpress-categories-with-term-management-tools-and-other-tweaks/">Term Management Tools</a>. Awesome.</li>
<li><strong>I manually maintain a more detailed categorical index</strong> at <a href="http://sach.ac/index">sach.ac/index</a>. This makes it easier for me to <em>see</em> when many blog posts are piling up in a category, and to organize them more logically.</li>
<li><strong>I set up short URLs for frequently-mentioned posts.</strong> The <a href="http://wordpress.org/plugins/redirection/">Redirection</a> plugin does a decent job at this. For example, people often ask me about the tools I use to draw, and it's great to just be able to type in <a href="http://sach.ac/sketchtools">http://sach.ac/sketchtools</a> as an answer.</li>
<li><strong>I post weekly and monthly reviews.</strong> The <a href="https://sachachua.com/blog/category/weekly">weekly</a> review includes links to that week's blog posts, and the <a href="https://sachachua.com/blog/category/monthly">monthly</a> review includes a categorized list. I've also set up daily, weekly, and monthly subscriptions based on the RSS feeds. This is probably overkill (more choices = lower subscriptions), but I want to give people options for how frequently they want updates. The weekly and monthly reviews are also helpful for me in terms of quickly getting a sense of the passage of time.</li>
<li><strong>I use Similar Posts to recommend other things people might be interested in.</strong> There are a number of similar plugins, so try different ones to see which one you like the most. I tried nRelate and the one from Zemanta, but I wasn't happy with the way those looked, so I'm back to plain text.</li>
<li><strong>I show recent comments.</strong> People often comment on really old posts, and this is a great way for other people to discover them.</li>
<li><strong>I use post titles in my next/previous navigation, and I labelled them &#8220;Older&#8221; and &#8220;Newer&#8221;.</strong> I think they're more interesting than</li>
<li><strong>I customized my theme pages to make it easier to skim through posts or get them in bulk.</strong> For example, <a href="https://sachachua.com/blog/2014/02">https://sachachua.com/blog/2014/02</a> lists all the posts for February. <a href="https://sachachua.com/blog/2014/?bulk=1">https://sachachua.com/blog/2014/?bulk=1</a> puts all the posts together so that I can copy and paste it into a Microsoft Word file. <a href="https://sachachua.com/blog/2014/?org=1">https://sachachua.com/blog/2014/?org=1</a> puts it in a special list form so that I can paste it into Org Mode in Emacs. You can also pass the number of posts to a category page: <a href="https://sachachua.com/blog/category/drawing/?posts_per_page=-1">https://sachachua.com/blog/category/drawing/?posts_per_page=-1</a> displays all the posts instead of paginating them. These tweaks make it easier for me to copy information, too.</li>
<li><strong>I give people the option to browse oldest posts first.</strong> Sometimes people prefer starting from the beginning, so I've added a link that switches the current view around.</li>
<li><strong>I have an &#8220;On this day&#8221; widget.</strong> Sometimes I notice interesting things in it. I used to put it at the end of a post, but I moved it to the sidebar to make the main column cleaner.</li>
<li><strong>For fun, I have a link that goes to a random post.</strong> I used to display random post titles in the sidebar, which might be an interesting approach to return to.</li>
<li><strong>I back up to many different places.</strong> I mirror my site as a development environment. I back up the database and the files to another web server and to my computer, and I duplicate the disk image with Linode too. I should set up incremental backups so that it's easier to go back in time, just in case.</li>
<li><strong>I rated my posts and archived my favourite ones as a PDF </strong>so that I'll still have them even if I mess up my database. Besides, it was a good excuse to read ten years of posts again.</li>
</ol>
<p>Hope that gives you some ideas for things to experiment with! I'm working on organizing more blog posts into trails and e-books. I'm also getting better at planning what I want to write about and learn. If you're curious about any of the techniques I use or you want to bounce around ideas, feel free to e-mail me at <a href="mailto:sacha@sachachua.com">sacha@sachachua.com</a> or <a href="https://sachachua.com/blog/meet">set up a chat</a>.</p>
<p><strong>Do you have a large blog? How do you manage it?</strong></p>

<p>You can <a href="https://sachachua.com/blog/2014/03/notes-managing-large-blog-archive/#comment">view 8 comments</a> or <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2014%2F03%2Fnotes-managing-large-blog-archive%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item><item>
		<title>WordPress: Make a sequence of posts easier to navigate with Organize Series</title>
		<link>https://sachachua.com/blog/2014/02/wordpress-make-sequence-posts-easier-navigate-organize-series/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Wed, 26 Feb 2014 13:00:42 GMT</pubDate>
    <category>wordpress</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=26914</guid>
		<description><![CDATA[<p><strong>You might have a lot to say, but you don't want to overwhelm the readers of your blog.</strong> It's a good idea to break up your posts into several shorter ones. That way, people don't have to scroll through an intimidating 10,000-word post. Sequences help with that. Write several blog posts and link them up so that people can follow the path.</p>
<p><strong>I've posted many blog posts that belong in sequences.</strong> Some of them are presentations and transcripts that I've spread out across time to make it easier for people to digest. Some of them are blog posts that I've organized after realizing how they're related. I used to link these posts by hand, updating each post with a link to the next one and linking each new post with the one before it. Creating one page that listed all the posts meant yet another page to keep up to date. It took time to set up these links, and I didn't always remember to do so.</p>
<p>When I look at my website analytics, I find that most of the visits are to pages that are deep within my archive. Besides the suggestions from Similar Posts, I also want to give people <strong>clearer paths through the content.</strong> That way, they can learn on their own. I wanted to make it easier to manage those trails through my blog posts without needing to edit many pages.</p>
<p><strong><a href="http://wordpress.org/plugins/organize-series/">Organize Series</a> </strong>is a WordPress plugin for sequences of posts. I like the way you can adjust the order of posts in the sequence. I customized Organize Series so that it didn't show the list of posts at the beginning of each post, but I kept the other defaults. Organize Series adds links to the next and previous post, and it also adds a link to a page with all the posts in the series. I like the way that Organize Series makes it easy for readers to see many posts on the same page.</p>
<p><strong>To see Organize Series in action,</strong> check out the series for <a href="https://sachachua.com/blog/series/a-visual-guide-to-emacs/">A Visual Guide to Emacs</a>. It links together three of the sketches I've made. I can add more posts as I publish them. You can also see the previous and next links in a post that belongs to a series, like this one for <a href="https://sachachua.com/blog/2013/09/sketchnote-lesson-using-color/">Adding Color</a>, the second lesson in this <a href="https://sachachua.com/blog/series/sketchnote-lessons-2/">Sketchnote Lessons series</a>. Check out <a href="https://sachachua.com/blog/series">the rest of my series</a> too.</p>
<p><strong>The Organize Series plugin is free,</strong> and there are commercial add-ons. I haven't bought one yet, although I find a few of them tempting. In the meantime, I'm looking forward to adding more series as I make my archive easier for people to use. Hope this helps!</p>
<p>Suggestions:</p>
<ul>
<li>If you have a self-hosted WordPress blog and you write sequences of blog posts, give Organize Series a try.</li>
<li>Curious about what I'm learning? Suggest some sequences for me to organize or write about!</li>
</ul>

<p>You can <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2014%2F02%2Fwordpress-make-sequence-posts-easier-navigate-organize-series%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item>
	</channel>
</rss>