Smart Sidebar doesn't work on CPT

Posted in: Newsmag
Post count: 44

Hello,

I have activated smart sidebar and it works correctly on single ‘Post’ post type, however, it doesn’t work on any other custom post type single pages. The single template is the same for all types. I can see tds_smart_sidebar="enabled" in the source code. I can see td-ss-main-sidebar class getting the following styles on page load – style="width: auto; position: static; top: auto; bottom: auto;"

Is there a reason why it only works for post. I tried looking through the code but couldn’t find any conditionals related to this

Post count: 7909

Hi,

The smart sidebar was designed to work on theme posts, page content when td-ss-row class is added to the row that you want to make sticky and also on loop(latest articles, categories…) Unfortunately it was not tested with custom post types so I cannot make any recommendations for this, sorry! We plan to improve and add better support for the custom post type in a future update.

Thanks!

Post count: 44

Thank you for replying. I understand it works only on posts, but where is the code that makes it to only work on posts? I would like to change that in the core theme. In what file is it determined if the single page is a post, custom post type or a page.

Post count: 6600

Hi,

On post pages the smart sidebar script is set to look for these 2 div’s: http://screencast.com/t/5iUqyWfSo1 so make sure you also have them added to your cpt template wrapping the main content and the main sidebar. You can take a look at one of the single template to see how they were built.

Thanks

Post count: 44

Hi Lucian,

I looked at it and the HTML structure is exactly the same for both post and custom post type but it still doesn’t work on the CPT.

Post count: 7909

Hi,

Like I said above we did not tested this on custom post and smart sidebar was not designed for this, you may need custom modification to implement it. Also please provide a link so we can take a look at this.

Thanks!

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.