Tagged: x
-
AuthorPosts
-
May 11, 2016 at 9:24 am #985898
briantbeckerParticipantUsing 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?
May 11, 2016 at 10:56 am #986057
RupokMemberHi 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.
May 11, 2016 at 2:56 pm #986454
briantbeckerParticipanthttp://jerper.staging.wpengine.com — it’s on my staging side
May 11, 2016 at 6:28 pm #986724
John EzraMemberHi 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 credentialsDon’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!
May 11, 2016 at 6:43 pm #986740
briantbeckerParticipantThis reply has been marked as private.May 11, 2016 at 10:34 pm #987092
briantbeckerParticipantThis reply has been marked as private.May 11, 2016 at 11:20 pm #987125
RupokMemberHi 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!
May 12, 2016 at 9:29 am #987844
briantbeckerParticipantI 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.
May 12, 2016 at 10:33 am #987935
briantbeckerParticipantTwo images.
May 12, 2016 at 10:36 am #987940
briantbeckerParticipantSo here it is inside cornerstone:

and here is the same page once you exit cornerstone:

Surely we can all agree that something is not right in your code…
May 12, 2016 at 1:41 pm #988274
briantbeckerParticipantI 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();`May 12, 2016 at 1:43 pm #988278
briantbeckerParticipantHere it is formatted:
May 12, 2016 at 1:53 pm #988302
RupokMemberHi 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!
May 12, 2016 at 3:08 pm #988412
briantbeckerParticipantDude (or dudette) – as you can see below none of this is relevant.
=====
The answer so far you’ve given me:- 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/ ) - 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) - enclose count = “3” in quotes
(really? – did you think to test that before you tried? It makes no difference.) - You asked for my u/p and ftp info
(but it doesn’t look like you’ve logged in yet…) - 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.
May 12, 2016 at 8:05 pm #988841
Rue NelModeratorHello 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 - don’t use raw content for shortcodes
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-985898 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
