<?xml version="1.0" encoding="UTF-8"?>
	<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"

			>

	<channel>

		<title>Recent Post Shortcode &#8211; Themeco Community</title>
		<atom:link href="https://theme.co/archive/forums/topic/recent-post-shortcode-2/feed/" rel="self" type="application/rss+xml" />
		<link>https://theme.co/archive/forums/topic/recent-post-shortcode-2/feed/</link>
		<description></description>
		<lastBuildDate>Thu, 30 Oct 2025 18:14:22 +0000</lastBuildDate>
		<generator>https://bbpress.org/?v=2.6.14</generator>
		<language>en-US</language>

		
														
					
				<item>
					<guid>https://theme.co/archive/forums/topic/recent-post-shortcode-2/#post-105361</guid>
					<title><![CDATA[Recent Post Shortcode]]></title>
					<link>https://theme.co/archive/forums/topic/recent-post-shortcode-2/#post-105361</link>
					<pubDate>Mon, 15 Sep 2014 20:39:57 +0000</pubDate>
					<dc:creator>Pauline H</dc:creator>

					<description>
						<![CDATA[
						<p>I&#8217;m using ethos:</p>
<p>I know how to add the recent posts shortcode to the widget area, my question is how do I make it a specific post id, so I can control what is showing.  I know I can by category but I would like to use specific posts.</p>
<p>Thanks</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/recent-post-shortcode-2/#post-105410</guid>
					<title><![CDATA[Reply To: Recent Post Shortcode]]></title>
					<link>https://theme.co/archive/forums/topic/recent-post-shortcode-2/#post-105410</link>
					<pubDate>Mon, 15 Sep 2014 22:32:16 +0000</pubDate>
					<dc:creator>Nabeel A</dc:creator>

					<description>
						<![CDATA[
						<p>Thanks for writing in! Regretfully, at this time I am not entirely certain what it is you would like to accomplish based on the information given in your post. If you wouldn&#8217;t mind providing us with a little more clarification on what it is you&#8217;re wanting to do (a link to a similar example site would be very helpful, or perhaps some screenshots), we&#8217;ll be happy to provide you with a response once we have a better understanding of the situation.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/recent-post-shortcode-2/#post-105413</guid>
					<title><![CDATA[Reply To: Recent Post Shortcode]]></title>
					<link>https://theme.co/archive/forums/topic/recent-post-shortcode-2/#post-105413</link>
					<pubDate>Mon, 15 Sep 2014 22:35:35 +0000</pubDate>
					<dc:creator>Pauline H</dc:creator>

					<description>
						<![CDATA[
						<p>I&#8217;m just wanting to know what I would add to the recent post shortcode to have the result based on a specific post instead of a category?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/recent-post-shortcode-2/#post-105505</guid>
					<title><![CDATA[Reply To: Recent Post Shortcode]]></title>
					<link>https://theme.co/archive/forums/topic/recent-post-shortcode-2/#post-105505</link>
					<pubDate>Tue, 16 Sep 2014 04:39:18 +0000</pubDate>
					<dc:creator>Christian</dc:creator>

					<description>
						<![CDATA[
						<p>Hey Pauline,</p>
<p>You&#8217;ll need to create a modified copy of the Recent Posts shortcode function. The file you need is <strong>shortcodes.php</strong> located in <strong>wp-content\plugins\x-shortcodes\functions</strong>. For an example, please add the code below in your functions.php. The code does what you need. Use the shortcode <code>[x_post post_id=&quot;1&quot;]</code> (post_id is the ID of your post). It is a modified copy of the Recent Posts shortcode function. Please compare the difference between the original (Recent Posts section in shortcodes.php and the modified copy.</p>
<pre><code>function x_shortcode_post( $atts ) {
  extract( shortcode_atts( array(
    &#039;id&#039;          =&gt; &#039;&#039;,
    &#039;class&#039;       =&gt; &#039;&#039;,
    &#039;style&#039;       =&gt; &#039;&#039;,
    &#039;type&#039;        =&gt; &#039;&#039;,
    &#039;category&#039;    =&gt; &#039;&#039;,
    &#039;no_image&#039;    =&gt; &#039;&#039;,
    &#039;fade&#039;        =&gt; &#039;&#039;,
    &#039;post_id&#039;     =&gt; &#039;&#039;
  ), $atts ) );

  $id            = ( $id          != &#039;&#039;          ) ? &#039;id=&quot;&#039; . esc_attr( $id ) . &#039;&quot;&#039; : &#039;&#039;;
  $class         = ( $class       != &#039;&#039;          ) ? &#039;x-recent-posts cf &#039; . esc_attr( $class ) : &#039;x-recent-posts cf&#039;;
  $style         = ( $style       != &#039;&#039;          ) ? &#039;style=&quot;&#039; . $style . &#039;&quot;&#039; : &#039;&#039;;
  $type          = ( $type        == &#039;portfolio&#039; ) ? &#039;x-portfolio&#039; : &#039;post&#039;;
  $category      = ( $category    != &#039;&#039;          ) ? $category : &#039;&#039;;
  $category_type = ( $type        == &#039;post&#039;      ) ? &#039;category_name&#039; : &#039;portfolio-category&#039;;
  $no_image      = ( $no_image    == &#039;true&#039;      ) ? $no_image : &#039;&#039;;
  $fade          = ( $fade        == &#039;true&#039;      ) ? $fade : &#039;false&#039;;

  $output = &quot;&lt;div {$id} class=\&quot;{$class}{$orientation}\&quot; {$style} data-fade=\&quot;{$fade}\&quot;&gt;&quot;;

    $q = new WP_Query( array(
      &#039;p&#039;          =&gt; $post_id
    ) );

    if ( $q-&gt;have_posts() ) : while ( $q-&gt;have_posts() ) : $q-&gt;the_post();

      if ( $no_image == &#039;true&#039; ) {
        $image_output       = &#039;&#039;;
        $image_output_class = &#039;no-image&#039;;
      } else {
        $image_output       = &#039;&lt;div class=&quot;x-recent-posts-img&quot;&gt;&#039; . get_the_post_thumbnail( get_the_ID(), &#039;entry-&#039; . get_theme_mod( &#039;x_stack&#039; ) . &#039;-cropped&#039;, NULL ) . &#039;&lt;/div&gt;&#039;;
        $image_output_class = &#039;with-image&#039;;
      }

      $output .= &#039;&lt;a class=&quot;x-recent-post&#039; . $count . &#039; &#039; . $image_output_class . &#039;&quot; href=&quot;&#039; . get_permalink( get_the_ID() ) . &#039;&quot; title=&quot;&#039; . esc_attr( sprintf( __( &#039;Permalink to: &quot;%s&quot;&#039;, &#039;__x__&#039; ), the_title_attribute( &#039;echo=0&#039; ) ) ) . &#039;&quot;&gt;&#039;
                 . &#039;&lt;article id=&quot;post-&#039; . get_the_ID() . &#039;&quot; class=&quot;&#039; . implode( &#039; &#039;, get_post_class() ) . &#039;&quot;&gt;&#039;
                   . &#039;&lt;div class=&quot;entry-wrap&quot;&gt;&#039;
                     . $image_output
                     . &#039;&lt;div class=&quot;x-recent-posts-content&quot;&gt;&#039;
                       . &#039;&lt;h3 class=&quot;h-recent-posts&quot;&gt;&#039; . get_the_title() . &#039;&lt;/h3&gt;&#039;
                       . &#039;&lt;span class=&quot;x-recent-posts-date&quot;&gt;&#039; . get_the_date() . &#039;&lt;/span&gt;&#039;
                     . &#039;&lt;/div&gt;&#039;
                   . &#039;&lt;/div&gt;&#039;
                 . &#039;&lt;/article&gt;&#039;
               . &#039;&lt;/a&gt;&#039;;

    endwhile; endif; wp_reset_postdata();
  
  $output .= &#039;&lt;/div&gt;&#039;;

  return $output;
}

add_shortcode( &#039;x_post&#039;, &#039;x_shortcode_post&#039; );</code></pre>
<p>Hope that helps. 🙂</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/recent-post-shortcode-2/#post-105515</guid>
					<title><![CDATA[Reply To: Recent Post Shortcode]]></title>
					<link>https://theme.co/archive/forums/topic/recent-post-shortcode-2/#post-105515</link>
					<pubDate>Tue, 16 Sep 2014 04:56:17 +0000</pubDate>
					<dc:creator>Pauline H</dc:creator>

					<description>
						<![CDATA[
						<p>Do I do this within the child theme? Will I have two shortcodes that work?  the old one and the new one?  I found the file, I&#8217;m confused as where to add it in that file.  It little more clarification would help.  Thanks so much! </p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/recent-post-shortcode-2/#post-105561</guid>
					<title><![CDATA[Reply To: Recent Post Shortcode]]></title>
					<link>https://theme.co/archive/forums/topic/recent-post-shortcode-2/#post-105561</link>
					<pubDate>Tue, 16 Sep 2014 07:02:50 +0000</pubDate>
					<dc:creator>Christian</dc:creator>

					<description>
						<![CDATA[
						<p>Hey Pauline,</p>
<p>It is best to put this in the <strong>functions.php</strong> of the child theme so it won&#8217;t get overridden by updates. Place the given code at the very end of the code in functions.php. The child theme&#8217;s functions.php file should be blank the first time you open it.</p>
<p>Thanks.</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

