<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>THE MOLITOR FORUMS &#187; Topic: FAQ - Adding support for BCE dates (user edit)</title>
		<link>http://www.themolitor.com/forums/topic/timeline-use-dates-in-the-far-past-eg-1550bce</link>
		<description>THE MOLITOR FORUMS &#187; Topic: FAQ - Adding support for BCE dates (user edit)</description>
		<language>en-US</language>
		<pubDate>Fri, 01 May 2026 11:02:28 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.themolitor.com/forums/search.php</link>
		</textInput>
		<atom:link href="http://www.themolitor.com/forums/rss/topic/timeline-use-dates-in-the-far-past-eg-1550bce" rel="self" type="application/rss+xml" />

		<item>
			<title>kavi.bhansali on "FAQ - Adding support for BCE dates (user edit)"</title>
			<link>http://www.themolitor.com/forums/topic/timeline-use-dates-in-the-far-past-eg-1550bce#post-39548</link>
			<pubDate>Sun, 03 Jul 2016 02:54:37 +0000</pubDate>
			<dc:creator>kavi.bhansali</dc:creator>
			<guid isPermaLink="false">39548@http://www.themolitor.com/forums/</guid>
			<description><p>Hello RobinLayField and DrWatson,</p>
<p>I tried implementing your solutions to get BC dates. I wanted the timeline to show posts dated as far back as 500 BC.</p>
<p>I changed line no. 21 to:</p>
<pre><code>$wp_query-&#62;query(&#039;meta_key=custom-year&#38;orderby=meta_value_num&#38;order=&#039;.$timelineOrder.&#039;&#38;cat=&#039;.$timelineMain.&#039;&#38;showposts=2000&#039;);</code></pre>
<p>The name of my custom field is "custom-year".</p>
<p>Also, I changed line no. 36 to:</p>
<pre><code>//IF CURRENT DATE HAS NOT BEEN SEEN...
/*if($thisDivider != $prevDivider &#38;&#38; $thisDivider != &#039;None&#039;){ ?&#62;&#60;div class=&#34;divider&#34;&#62;&#60;?php echo $thisDivider; ?&#62;&#60;/div&#62;&#60;!--end divider--&#62;&#60;?php } */
$thisDivider = ( $thisDivider &#60; 0 ) ? ltrim( $thisDivider, &#039;-&#039; ) . &#039; BCE&#039; : $thisDivider;</code></pre>
<p>I am not able to however see the "Sample post" year as "500BC" at <a href="http://thebigindianpicture.com/ihcbeta" rel="nofollow">http://thebigindianpicture.com/ihcbeta</a>. In fact, the blue year label has also disappeared. Can you please help me out? Am I doing this right?
</p></description>
		</item>
		<item>
			<title>drwatson on "FAQ - Adding support for BCE dates (user edit)"</title>
			<link>http://www.themolitor.com/forums/topic/timeline-use-dates-in-the-far-past-eg-1550bce#post-31377</link>
			<pubDate>Fri, 17 Oct 2014 05:27:24 +0000</pubDate>
			<dc:creator>drwatson</dc:creator>
			<guid isPermaLink="false">31377@http://www.themolitor.com/forums/</guid>
			<description><p>Hi Vincent,</p>
<p>The $thisDivider variable is derived from the $thisYear and $prevYear. See lines 29-34 in index.php.<br />
See my post above for the replacements you need to make.  Also i think $prevYear has to be corrected using this code.</p>
<p>index.php (replace line 66 with:)<br />
<pre><code>$prev_year = substr($timelineDate, 0, (strpos($timelineDate, &#039;-&#039;) &#60; 4 ? $timelineDate : strpos($timelineDate, &#039;-&#039;)));</code></pre>
<p>Let me know if this helps
</p></description>
		</item>
		<item>
			<title>Vincent on "FAQ - Adding support for BCE dates (user edit)"</title>
			<link>http://www.themolitor.com/forums/topic/timeline-use-dates-in-the-far-past-eg-1550bce#post-31339</link>
			<pubDate>Wed, 15 Oct 2014 11:49:09 +0000</pubDate>
			<dc:creator>Vincent</dc:creator>
			<guid isPermaLink="false">31339@http://www.themolitor.com/forums/</guid>
			<description><p>I ran in to the same problem. It seems to me that the problem with displaying the decades comes from the date the post is added. By changing the posting date you can change the decade that is shown. However, this means that you cannot add BC dates TO properly show in decades.</p>
<p>Maybe someone who i actually able to write and read html can find the problem and fix it. I am pretty sure the problem is how I described it (see <a href="http://www.hetfilosofischkompas.nl/" rel="nofollow">http://www.hetfilosofischkompas.nl/</a>, see for example the fact that the decade of Aristoteles is 2010s, while the next two are in decades before).</p>
<p>Also I wanted to know where i have to add the following line:<br />
<pre><code>$thisDivider = ( $thisDivider &#60; 0 ) ? ltrim( $thisDivider, &#039;-&#039; ) . &#039; BCE&#039; : $thisDivider;</code></pre>
<p>Should I replace line 36, add the code on line 37 or should it be somewhere in the following line of code:</p>
<pre><code>if($thisDivider != $prevDivider){ ?&#62;&#60;div class=&#34;divider&#34;&#62;&#60;?php echo $thisDivider; ?&#62;&#60;/div&#62;&#60;!--end divider--&#62;&#60;?php }</code></pre></description>
		</item>
		<item>
			<title>drwatson on "FAQ - Adding support for BCE dates (user edit)"</title>
			<link>http://www.themolitor.com/forums/topic/timeline-use-dates-in-the-far-past-eg-1550bce#post-31168</link>
			<pubDate>Mon, 06 Oct 2014 23:10:55 +0000</pubDate>
			<dc:creator>drwatson</dc:creator>
			<guid isPermaLink="false">31168@http://www.themolitor.com/forums/</guid>
			<description><p>I did see the issue. How are you changing the category? Are you modifying the query?
</p></description>
		</item>
		<item>
			<title>vicentelamonaca on "FAQ - Adding support for BCE dates (user edit)"</title>
			<link>http://www.themolitor.com/forums/topic/timeline-use-dates-in-the-far-past-eg-1550bce#post-31098</link>
			<pubDate>Wed, 01 Oct 2014 00:43:58 +0000</pubDate>
			<dc:creator>vicentelamonaca</dc:creator>
			<guid isPermaLink="false">31098@http://www.themolitor.com/forums/</guid>
			<description><p>Thanks drwatson.</p>
<p>Look at the years.</p>
<p><a href="http://lamonaca.org/tiempo/" rel="nofollow">http://lamonaca.org/tiempo/</a><br />
works well</p>
<p><a href="http://lamonaca.org/tiempo/category/arte/suprematismo/" rel="nofollow">http://lamonaca.org/tiempo/category/arte/suprematismo/</a><br />
but in this the years are lost. all appear as "2010's"</p>
<p>If you can, browse through the catgorías from the homepage.</p>
<p>once you leave lamonaca.org/tiempo to lamonaca.org/tiempo/"any category"year is lost</p>
<p>thank you very much for your time
</p></description>
		</item>
		<item>
			<title>drwatson on "FAQ - Adding support for BCE dates (user edit)"</title>
			<link>http://www.themolitor.com/forums/topic/timeline-use-dates-in-the-far-past-eg-1550bce#post-31097</link>
			<pubDate>Tue, 30 Sep 2014 21:53:53 +0000</pubDate>
			<dc:creator>drwatson</dc:creator>
			<guid isPermaLink="false">31097@http://www.themolitor.com/forums/</guid>
			<description><p>I've checked both of your links and they look the same:<br />
<a href="http://lamonaca.org/tiempo/" rel="nofollow">http://lamonaca.org/tiempo/</a><br />
and<br />
<a href="http://lamonaca.org/tiempo/category/arte/suprematismo/" rel="nofollow">http://lamonaca.org/tiempo/category/arte/suprematismo/</a></p>
<p>Please clarify what you think is showing/working incorrectly.
</p></description>
		</item>
		<item>
			<title>vicentelamonaca on "FAQ - Adding support for BCE dates (user edit)"</title>
			<link>http://www.themolitor.com/forums/topic/timeline-use-dates-in-the-far-past-eg-1550bce#post-31094</link>
			<pubDate>Tue, 30 Sep 2014 17:00:10 +0000</pubDate>
			<dc:creator>vicentelamonaca</dc:creator>
			<guid isPermaLink="false">31094@http://www.themolitor.com/forums/</guid>
			<description><p>Hello drwatson </p>
<p>I followed the steps and almost everything works. </p>
<p>When I'm in index runs smoothly. (<a href="http://lamonaca.org/tiempo/" rel="nofollow">http://lamonaca.org/tiempo/</a>) </p>
<p>within categories but dates are not displayed correctly. (<a href="http://lamonaca.org/tiempo/category/arte/suprematismo/" rel="nofollow">http://lamonaca.org/tiempo/category/arte/suprematismo/</a>) </p>
<p>Can you help me? </p>
<p>thank you very much
</p></description>
		</item>
		<item>
			<title>robinlayfield on "FAQ - Adding support for BCE dates (user edit)"</title>
			<link>http://www.themolitor.com/forums/topic/timeline-use-dates-in-the-far-past-eg-1550bce#post-30396</link>
			<pubDate>Fri, 08 Aug 2014 03:33:44 +0000</pubDate>
			<dc:creator>robinlayfield</dc:creator>
			<guid isPermaLink="false">30396@http://www.themolitor.com/forums/</guid>
			<description><p>Well spotted on the <code>%timelineOrder!</code>  Thanks for correcting the code.
</p></description>
		</item>
		<item>
			<title>drwatson on "FAQ - Adding support for BCE dates (user edit)"</title>
			<link>http://www.themolitor.com/forums/topic/timeline-use-dates-in-the-far-past-eg-1550bce#post-30394</link>
			<pubDate>Thu, 07 Aug 2014 23:57:47 +0000</pubDate>
			<dc:creator>drwatson</dc:creator>
			<guid isPermaLink="false">30394@http://www.themolitor.com/forums/</guid>
			<description><p>Here's a little extra if you want to display the sorting dates instead of post dates as part of the title and use the custom field for the decades. Also there was a type in the code above (%timelineOrder instead of $timelineOrder):</p>
<p>The following is assuming "timeline-date" is the custom field key.</p>
<p>index.php (replace line 21 with:)<br />
<pre><code>$wp_query-&#62;query(&#039;meta_key=timeline-date&#38;orderby=meta_value_num&#38;order=&#039;.$timelineOrder.&#039;&#38;cat=&#039;.$timelineMain.&#039;&#38;showposts=2000&#039;); // Changing date</code></pre>
<p>To use the custom field for dividers:<br />
index.php (replace line 29 with:)<br />
<pre><code>$timelineDate = get_post_meta(get_the_id(), &#039;timeline-date&#039;, true);
$thisYear = substr($timelineDate, 0, (strpos($timelineDate, &#039;-&#039;) &#60; 4 ? $timelineDate : strpos($timelineDate, &#039;-&#039;)));</code></pre>
<p>Finally to use the custom field for the post title<br />
index.php (replace line 52 with:)<br />
<pre><code>&#60;h2&#62;&#60;?php the_title(); if($titleYear){ ?&#62; - &#60;?php echo($timelineDate); } ?&#62;&#60;/h2&#62;</code></pre>
<p>Hope someone else finds this useful. :-)</p>
<p>Thanks,<br />
Marcin
</p></description>
		</item>
		<item>
			<title>THE MOLITOR on "FAQ - Adding support for BCE dates (user edit)"</title>
			<link>http://www.themolitor.com/forums/topic/timeline-use-dates-in-the-far-past-eg-1550bce#post-29494</link>
			<pubDate>Wed, 28 May 2014 08:59:41 +0000</pubDate>
			<dc:creator>THE MOLITOR</dc:creator>
			<guid isPermaLink="false">29494@http://www.themolitor.com/forums/</guid>
			<description><p>@robinlayfield thanks for following up!
</p></description>
		</item>
		<item>
			<title>robinlayfield on "FAQ - Adding support for BCE dates (user edit)"</title>
			<link>http://www.themolitor.com/forums/topic/timeline-use-dates-in-the-far-past-eg-1550bce#post-29490</link>
			<pubDate>Tue, 27 May 2014 23:44:38 +0000</pubDate>
			<dc:creator>robinlayfield</dc:creator>
			<guid isPermaLink="false">29490@http://www.themolitor.com/forums/</guid>
			<description><p>Hi, </p>
<p>I wasn't very clear: the custom field just needs to contain a year but it should work for a mysql-formatted date, eg. 2014-05-28.</p>
<p>Robin
</p></description>
		</item>
		<item>
			<title>whatsongroup on "FAQ - Adding support for BCE dates (user edit)"</title>
			<link>http://www.themolitor.com/forums/topic/timeline-use-dates-in-the-far-past-eg-1550bce#post-29476</link>
			<pubDate>Tue, 27 May 2014 12:23:48 +0000</pubDate>
			<dc:creator>whatsongroup</dc:creator>
			<guid isPermaLink="false">29476@http://www.themolitor.com/forums/</guid>
			<description><p>Couldn't be  able to get this work , Value field should contain the date format?</p>
<p>I have replaced with the following code for custom field 'key'</p>
<pre><code>$wp_query-&#62;query( &#039;meta_key=key&#38;orderby=meta_value_num&#38;order=&#039;.$timelineOrder.&#039;&#38;cat=&#039;.%timelineMain.&#039;&#38;showposts=2000&#039;);</code></pre>
<p>Please advice</p>
<p>Thank you
</p></description>
		</item>
		<item>
			<title>THE MOLITOR on "FAQ - Adding support for BCE dates (user edit)"</title>
			<link>http://www.themolitor.com/forums/topic/timeline-use-dates-in-the-far-past-eg-1550bce#post-29272</link>
			<pubDate>Thu, 15 May 2014 08:59:31 +0000</pubDate>
			<dc:creator>THE MOLITOR</dc:creator>
			<guid isPermaLink="false">29272@http://www.themolitor.com/forums/</guid>
			<description><p>You rock! Thanks for sharing this :-)</p>
<p>Best,</p>
<p>Chris
</p></description>
		</item>
		<item>
			<title>robinlayfield on "FAQ - Adding support for BCE dates (user edit)"</title>
			<link>http://www.themolitor.com/forums/topic/timeline-use-dates-in-the-far-past-eg-1550bce#post-29264</link>
			<pubDate>Thu, 15 May 2014 02:26:44 +0000</pubDate>
			<dc:creator>robinlayfield</dc:creator>
			<guid isPermaLink="false">29264@http://www.themolitor.com/forums/</guid>
			<description><p><strong>CHANGING TIMELINE TO SORT BY CUSTOM FIELD</strong></p>
<p>The query that the Timeline uses can be changed to sort by custom field, like this:</p>
<p>index.php: line 21, change from this:</p>
<pre><code>$wp_query-&#62;query(&#039;order=&#039;.$timelineOrder.&#039;&#38;cat=&#039;.$timelineMain.&#039;&#38;showposts=2000&#039;);</code></pre>
<p>to this:</p>
<pre><code>$wp_query-&#62;query( &#039;meta_key=custom-field-name&#38;orderby=meta_value_num&#38;order=&#039;.$timelineOrder.&#039;&#38;cat=&#039;.%timelineMain.&#039;&#38;showposts=2000&#039;);</code></pre>
<p>and replace custom-field-name with whatever the custom field is called</p>
<p>Make sure you edit all your timeline posts to set the appropriate custom field for them.</p>
<p><strong>DISPLAYING BCE DATES</strong></p>
<p>To display BCE dates using the sort ordering above, give the custom field a negative value (eg. -500 for 500BCE) and then make a small change to the index file to change the label</p>
<p>index.php: line 36, add the following line<br />
<pre><code>//IF CURRENT DATE HAS NOT BEEN SEEN...
$thisDivider = ( $thisDivider &#60; 0 ) ? ltrim( $thisDivider, &#039;-&#039; ) . &#039; BCE&#039; : $thisDivider;</code></pre>
<p>This will remove the negative sign and append BCE to the label.</p>
<p>That's it!</p>
<p>Robin
</p></description>
		</item>

	</channel>
</rss>
