Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1224860
    Reid F
    Participant

    I’d like to use the recent post shortcode to display a page instead of a post.

    I’ve been looking at the function that was suggested in this forum thread:

    https://community.theme.co/forums/topic/recent-post-shortcode-2/

    They have the right idea but I can’t get it to work to pull up a page.

    Is there a way this is possible?

    Thanks

    #1225002
    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! You do not have to modify the recent post shortcode. You just need an add_filter() and you will be able to use the page in recent post element within Cornerstone. Since you already have your child theme active and ready, please insert this following code in your child theme’s functions.php file.

    // Add page type to recent posts element
    // =============================================================================
    function add_page_post_type( $types ) {
      $types['page'] = 'page';
      return $types;
    }
    add_filter( 'cs_recent_posts_post_types', 'add_page_post_type' );
    // =============================================================================

    And then edit your page in Cornerstone, insert recent posts element and you will have this: http://prntscr.com/cwz40g

    Hope this helps.

    #1225595
    Reid F
    Participant

    That is working great. How can I pull in a page by its page id? Right now it is just pulling in by the most recent published pages.

    #1226005
    Friech
    Moderator

    Hi There,

    Regretfully, further customizations from here would be getting into custom development, which is outside the scope of support we can offer. If you need more in depth changes, you may wish to consult with a developer. X is quite extensible with child themes, so there are plenty of possibilities.

    Thanks for understanding.

  • <script> jQuery(function($){ $("#no-reply-1224860 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>