Reply To: Can't overwrite with custom content within single post / Question about slick

Home Forums Product Support Forums Related Posts Pro for WordPress Support Can't overwrite with custom content within single post / Question about slick Reply To: Can't overwrite with custom content within single post / Question about slick

#10900
Ernest Marcinko
Ernest Marcinko
Keymaster

Hi!

1. I recall it was something with the de-coding of the custom based content, but we weren’t able to tell what it was caused by, and why.
I think however I might be able to suggest a solution, but it involves editing the plugin source, so have a back-up just in case.

Open up the wp-content\plugins\related-posts-pro\includes\shortcodes.php file and scroll to lines 66-67, which should be:

if (isset($rpp_data['selected-customcontent']) && count($rpp_data['selected-customcontent']) > 0)
    $defaultContent = $rpp_data['selected-customcontent'];

and replace those lines with this:

if ( isset($rpp_data['customcontent']) ) {
    $rpp_data['selected-customcontent'] = explode('|', $rpp_data['customcontent']);
    foreach ($rpp_data['selected-customcontent'] as $kk => &$vv)
        $vv = json_decode(base64_decode($vv), false);
    unset($vv);
}
if (isset($rpp_data['selected-customcontent']) && count($rpp_data['selected-customcontent']) > 0)
    $defaultContent = $rpp_data['selected-customcontent'];

This should solve it hopefully.

2. In this case I think you are better off by defining a pixel width, instead of a percentage one I believe.

The slick and slide scripts tries to resize the elements in a way that always a “whole” number of items are displayed. So the size defined there is just a starting point.

Another possible solution might be to use media queries to override the initial widths. These will only apply when the page is reloaded with a different size – as the slick layout parses the initial width on page load. I haven’t actually tried this, but I would do something like this:

@media only screen and (max-width: 1200px)  {
  div[id^="relatedpostspro_0_"].rpp_slick .rpp_item {
      width: 33%;
  }
}

@media only screen and (max-width: 780px)  {
  div[id^="relatedpostspro_0_"].rpp_slick .rpp_item {
      width: 50%;
  }
}

@media only screen and (max-width: 320px)  {
  div[id^="relatedpostspro_0_"].rpp_slick .rpp_item {
      width: 100%;
  }
}

I’m not sure if these will work, but the slick script should get the variable values based on the screen size.

Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)