Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #985898
    briantbecker
    Participant

    Using the shortcode inside cornerstone displays the proper number of items (count = 3) see Capture1.png , but if I save and exit and view the page the number of post items displayed goes back to 8 (see Capture2.png).

    Help?

    #986057
    Rupok
    Member

    Hi there,

    It seems breaking the layout and pushing the recent posts to new line. To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    #986454
    briantbecker
    Participant

    http://jerper.staging.wpengine.com — it’s on my staging side

    #986724
    John Ezra
    Member

    Hi there,

    Thanks for updating the thread! We may need to check on this further on your site. We are unable to replicate it on our local test sites. Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    In the meantime you can also try using the recent posts element instead of writing out the shortcode.

    Let us know how that goes. Hope this helps – thanks!

    #986740
    briantbecker
    Participant
    This reply has been marked as private.
    #987092
    briantbecker
    Participant
    This reply has been marked as private.
    #987125
    Rupok
    Member

    Hi there,

    Thanks for updating. It seems you have blank column that causing the issue – http://prntscr.com/b31ewx

    Also you are using the Recent Posts shortcode within Raw Content but you don’t need to do that in Cornerstone. There is already “Recent Posts” element that you can use. Let’s use that and remove the column if you don’t have content for this.

    Cheers!

    #987844
    briantbecker
    Participant

    I can’t use your cornerstone “recent posts” because that doesn’t allow me to “override” it in functions.php and include the excerpt, make it tags rather than categories, etc.

    But that’s a really crappy answer anyway, no? The shortcode isn’t pulling the right number of items and you say “Oh, to fix that don’t use the shortcode.”

    As you can see (by my images in my first post or by going in and looking) on the admin side, the shortcode is correctly restricting the number of posts correctly, but outside of admin, it is not.

    I’ve “put content in that blank column” so you can see that was not the reason for this issue.

    Let’s look a little deeper here and figure this out.

    #987935
    briantbecker
    Participant

    Two images.

    #987940
    briantbecker
    Participant

    So here it is inside cornerstone:
    inside cornerstone

    and here is the same page once you exit cornerstone:
    outside cornerstone

    Surely we can all agree that something is not right in your code…

    #988274
    briantbecker
    Participant

    I hacked it myself, but this shouldn’t be needed.

    What you have: `
    $q = new WP_Query( array(
    ‘orderby’ => ‘date’,
    ‘post_type’ => “{$type}”,
    ‘posts_per_page’ => “{$count}”,
    ‘offset’ => “{$offset}”,
    “{$category_type}” => “{$category}”
    ) );
    if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();`

    But that gives more than “$count” posts for some WEIRD reason:
    What I now have that works:`
    $q = new WP_Query( array(
    ‘orderby’ => ‘date’,
    ‘post_type’ => “{$type}”,
    ‘posts_per_page’ => “{$count}”,
    ‘offset’ => “{$offset}”,
    “{$category_type}” => “{$category}”
    ) );
    $counter = 0;
    if ( $q->have_posts() ) : while ( $q->have_posts() && $counter++ < $count ) : $q->the_post();`

    #988278
    briantbecker
    Participant

    Here it is formatted:

    #988302
    Rupok
    Member

    Hi there,

    Sorry for the confusion but I think you didn’t get my reply. I didn’t say or mean “Oh, to fix that don’t use the shortcode.” rather pointed that there is already Recent Posts element so you don’t need to use shortcode within Cornerstone. I didn’t know you have modified this with custom code. So something like “crappy answer” not really sounds good here and not professional at all and it would be better if we try to understand the issue a bit to come to a feasible solution.

    However I can see you have placed :

    [x_recent_posts count=3]

    But if you notice the shortcode page (http://theme.co/x/demo/integrity/1/shortcodes/recent-posts/), it should be like below :

    [x_recent_posts count="3"]

    So let’s update this to correct format and always use Text Element to place shortcode instead of RAW Content since RAW content is supposed to use for HTML and scripts.

    If you face any extra spacing issue below image then you can use this CSS under Customize > Custom > CSS :

    .x-recent-posts .x-recent-posts-img {
      padding-bottom: 0;
    }

    If you still face any issue kindly let us know.

    Cheers!

    #988412
    briantbecker
    Participant

    Dude (or dudette) – as you can see below none of this is relevant.

    =====
    The answer so far you’ve given me:

    1. don’t use raw content for shortcodes
      (I’m not sure why you say this since other ThemeCo support techs say you can. Like Paul R “You can add this shortcode in a raw content element.” – https://community.theme.co/forums/topic/wrapping-cornerstone-sections-in-shortcodes/ )
    2. you have blank column that causing the issue – http://prntscr.com/b31ewx
      (how in the world can you believe this is caused by a blank column)
    3. enclose count = “3” in quotes
      (really? – did you think to test that before you tried? It makes no difference.)
    4. You asked for my u/p and ftp info
      (but it doesn’t look like you’ve logged in yet…)
    5. you don’t need to do that in Cornerstone just use the Recent Posts module
      (though I’ve said why I can’t, you aren’t solving a bug in your code by suggesting I do it another way)

    I think that “crappy answer” was deserved. Please pass this up the chain.

    #988841
    Rue Nel
    Moderator

    Hello There,

    I have tried everything I could. I later found out that you have heavily modified the recent post shortcode. In your code, you have this:

    
    while ( $q->have_posts() && $counter++ < $count )

    and the original code is just this:

    
    while ( $q->have_posts() )

    You have to restore to the original code or at least remove your custom condition.

    Please check out this topics for the original code:
    https://community.theme.co/forums/topic/recent-posts-shortcode-but-then-with-a-little-text-excerpt-and-read-more-link/#post-612688
    https://community.theme.co/forums/topic/recent-posts-shortcode-with-excerpt-without-linking-the-text/
    https://community.theme.co/forums/topic/add-excerpt-to-recent-posts-shortcode/#post-66964

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