Theme options for cpt missing / wpautop

info1496
14 Posts
info1496 posted this 26 April 2017

Hi,

I have a Custom Post type and created a post in it. For some reason the wpautop seems to be broken there.
Usually when that happens I use the Theme options box beside the editor to get the breaks back. But this box is not available in my post type and i can´t find a way to show it.

Any suggestions? Thank you!

Hi, I have a Custom Post type and created a post in it. For some reason the wpautop seems to be broken there. Usually when that happens I use the Theme options box beside the editor to get the breaks back. But this box is not available in my post type and i can´t find a way to show it. Any suggestions? Thank you!
Vote to pay developers attention to this features or issue.
16 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 27 April 2017

Hi,

Sorry, the problem is a little bit not clear. Why the theme options are not available for you. Maybe some screen shots will be helpful.

Sincerely,
Hella

Hi, Sorry, the problem is a little bit not clear. Why the theme options are not available for you. Maybe some screen shots will be helpful. Sincerely, Hella
info1496
14 Posts
info1496 posted this 27 April 2017

Hi Hella,

I attached some...

Is there anything I have to add to 'supports' in my cpt-code?

Regards, Timo

Hi Hella, I attached some... Is there anything I have to add to 'supports' in my cpt-code? Regards, Timo
Support Team
Support Team posted this 27 April 2017

Hi,

Could you please explain in some details the issue with auto paragraphs in custom posts. As I can see they should have autop feature enabled by default.
Does the issue happen with the default WP theme enabled?

Thank you,
Olivia

Hi, Could you please explain in some details the issue with auto paragraphs in custom posts. As I can see they should have autop feature enabled by default. Does the issue happen with the default WP theme enabled? Thank you, Olivia
info1496
14 Posts
info1496 posted this 27 April 2017

Hi,

no, it doesn´t with default theme.

i often have that issue that I break the paragraphs from within Themler by mistake. Normally I go to the article and re-check that box in Themler options. But this doesn´t exist for my cpt.

I can´t explain it much better...

Hi, no, it doesn´t with default theme. i often have that issue that I break the paragraphs from within Themler by mistake. Normally I go to the article and re-check that box in Themler options. But this doesn´t exist for my cpt. I can´t explain it much better...
Support Team
Support Team posted this 28 April 2017

Hello,
do you mean that even if 'Automatically add paragraphs' option is enabled on WP admin back end for page, the paragraphs are not added or disappears with Themler themes?

For example 'Automatically add paragraphs' option is enabled but in Themler you see text without line breaks:
In WP

WP-P.png

In Themler

ThemlerP.png

If my assumption is correct then I need to say that this is known issue. Actually it is treated as specific feature. To add line beaks it is recommended to do it directly in Themler in HTML or Text controls.

regards,
Aileen

Hello, do you mean that even if 'Automatically add paragraphs' option is enabled on WP admin back end for page, the paragraphs are not added or disappears with Themler themes? For example 'Automatically add paragraphs' option is enabled but in Themler you see text without line breaks: In WP !WP-P.png! In Themler !ThemlerP.png! If my assumption is correct then I need to say that this is known issue. Actually it is treated as specific feature. To add line beaks it is recommended to do it directly in Themler in HTML or Text controls. regards, Aileen
info1496
14 Posts
info1496 posted this 28 April 2017

Hi Aileen,

exactly...
I don´t like to edit content through Themler as this adds html tags to my posts.

I am fine with the checkbox solution within the Theme options box beside the editor. It has always worked fine to get the paragraphs back.
Can you tell me why this box is not showing up in my CPT or how I can make it show up?

Hi Aileen, exactly... I don´t like to edit content through Themler as this adds html tags to my posts. I am fine with the checkbox solution within the Theme options box beside the editor. It has always worked fine to get the paragraphs back. Can you tell me why this box is not showing up in my CPT or how I can make it show up?
info1496
14 Posts
info1496 posted this 29 April 2017

Hi,
two more screenshots attached to show what I mean...

Regards, Timo

Hi, two more screenshots attached to show what I mean... Regards, Timo
Support Team
Support Team posted this 01 May 2017

Hello,
1.regarding the line breaks. There's no way to change the behavior now. So please follow my recommendations above and add line breaks in Themler.

2.regarding the screenshot
http://attachments.answers.billiondigital.com/572/26572/support-cpt-1.jpg
As I understand the checkbox 'Theme options' disappeared, right? If you switch to one of default WP themes, to do you see the 'Theme options' checkbox?

Regards,
Aileen

Hello, 1.regarding the line breaks. There's no way to change the behavior now. So please follow my recommendations above and add line breaks in Themler. 2.regarding the screenshot http://attachments.answers.billiondigital.com/572/26572/support-cpt-1.jpg As I understand the checkbox 'Theme options' disappeared, right? If you switch to one of default WP themes, to do you see the 'Theme options' checkbox? Regards, Aileen
info1496
14 Posts
info1496 posted this 02 May 2017

Hi,

isn´t that theme options box a Themler function? I haven´t seen this specific box with any other theme so it won´t appear switching to another theme.

If I ativate a themler theme it appears with pages and posts but not with my custom post types. Why?
If I had this box I could use the checkbox to get the line breaks back. As I do in pages and posts when they accidently break...

Regards

Hi, isn´t that theme options box a Themler function? I haven´t seen this specific box with any other theme so it won´t appear switching to another theme. If I ativate a themler theme it appears with pages and posts but not with my custom post types. Why? If I had this box I could use the checkbox to get the line breaks back. As I do in pages and posts when they accidently break... Regards
Support Team
Support Team posted this 04 May 2017

Hi,

The theme options metaboxes in Themler theme are hardcoded to be available on Posts and Pages only. One of the reasons is that theme options are different for Page and Posts. Unfortunately there is no easy way to add them on custom post types.

Thank you,
Olivia

Hi, The theme options metaboxes in Themler theme are hardcoded to be available on Posts and Pages only. One of the reasons is that theme options are different for Page and Posts. Unfortunately there is no easy way to add them on custom post types. Thank you, Olivia
info1496
14 Posts
info1496 posted this 04 May 2017

Hi,

ok.

Can you give me a quick advise how to add the line breaks with Themler for my above example?

Thanks

Hi, ok. Can you give me a quick advise how to add the line breaks with Themler for my above example? Thanks
Support Team
Support Team posted this 05 May 2017

Hi,

Please open theme functions.php file in the Appearance >> Editor, find the following function:

function theme_get_content($args = array()) {
$post_id = get_queried_object_id();
$more_tag = theme_get_array_value($args, 'more_tag', __('Continue reading <span class="meta-nav">&rarr;</span>', 'default'));
$ignore_wpautop = theme_get_meta_option($post_id, 'theme_use_wpautop') === '0';
if ($ignore_wpautop) {
remove_filter('the_content', 'wpautop');
}
theme_ob_start();
the_content($more_tag);
$content = theme_ob_get_clean();
if ($ignore_wpautop) {
add_filter('the_content', 'wpautop');
}
return $content . wp_link_pages(array(
'before' => '<p><span class="page-navi-outer page-navi-caption"><span class="page-navi-inner">' . __('Pages', 'default') . ': </span></span>',
'after' => '</p>',
'link_before' => '<span class="page-navi-outer"><span class="page-navi-inner">',
'link_after' => '</span></span>',
'echo' => 0
));
}

and change it to:

function theme_get_content($args = array()) {
$post = get_queried_object();
$more_tag = theme_get_array_value($args, 'more_tag', __('Continue reading <span class="meta-nav">&rarr;</span>', 'default'));
$ignore_wpautop = isset($post->post_type) && ($post->post_type === 'post' || $post->post_type === 'page') && theme_get_meta_option($post->ID, 'theme_use_wpautop') === '0';
if ($ignore_wpautop) {
remove_filter('the_content', 'wpautop');
}
theme_ob_start();
the_content($more_tag);
$content = theme_ob_get_clean();
if ($ignore_wpautop) {
add_filter('the_content', 'wpautop');
}
return $content . wp_link_pages(array(
'before' => '<p><span class="page-navi-outer page-navi-caption"><span class="page-navi-inner">' . __('Pages', 'default') . ': </span></span>',
'after' => '</p>',
'link_before' => '<span class="page-navi-outer"><span class="page-navi-inner">',
'link_after' => '</span></span>',
'echo' => 0
));
}

This should help.

Thank you,
Olivia

Hi, Please open theme functions.php file in the Appearance >> Editor, find the following function: `function theme_get_content($args = array()) { $post_id = get_queried_object_id(); $more_tag = theme_get_array_value($args, 'more_tag', __('Continue reading <span class="meta-nav">&rarr;</span>', 'default')); $ignore_wpautop = theme_get_meta_option($post_id, 'theme_use_wpautop') === '0'; if ($ignore_wpautop) { remove_filter('the_content', 'wpautop'); } theme_ob_start(); the_content($more_tag); $content = theme_ob_get_clean(); if ($ignore_wpautop) { add_filter('the_content', 'wpautop'); } return $content . wp_link_pages(array( 'before' => '<p><span class="page-navi-outer page-navi-caption"><span class="page-navi-inner">' . __('Pages', 'default') . ': </span></span>', 'after' => '</p>', 'link_before' => '<span class="page-navi-outer"><span class="page-navi-inner">', 'link_after' => '</span></span>', 'echo' => 0 )); }` and change it to: `function theme_get_content($args = array()) { $post = get_queried_object(); $more_tag = theme_get_array_value($args, 'more_tag', __('Continue reading <span class="meta-nav">&rarr;</span>', 'default')); $ignore_wpautop = isset($post->post_type) && ($post->post_type === 'post' || $post->post_type === 'page') && theme_get_meta_option($post->ID, 'theme_use_wpautop') === '0'; if ($ignore_wpautop) { remove_filter('the_content', 'wpautop'); } theme_ob_start(); the_content($more_tag); $content = theme_ob_get_clean(); if ($ignore_wpautop) { add_filter('the_content', 'wpautop'); } return $content . wp_link_pages(array( 'before' => '<p><span class="page-navi-outer page-navi-caption"><span class="page-navi-inner">' . __('Pages', 'default') . ': </span></span>', 'after' => '</p>', 'link_before' => '<span class="page-navi-outer"><span class="page-navi-inner">', 'link_after' => '</span></span>', 'echo' => 0 )); }` This should help. Thank you, Olivia
info1496
14 Posts
info1496 posted this 08 May 2017

Hi,
thank you. This is not update safe, is it?
Can I overwrite the function from my custom functions plugin?

Thanks, Timo

Hi, thank you. This is not update safe, is it? Can I overwrite the function from my custom functions plugin? Thanks, Timo
Support Team
Support Team posted this 10 May 2017

Hi,

Themler overwrites functions.php in some cases depending on the theme modifications. But in most of cases custom changes should be saved.

Can I overwrite the function from my custom functions plugin?

I don't know how the plugin you're referring to works but most probably the fix will not work in this case.

Thank you,
Olivia

Hi, Themler overwrites functions.php in some cases depending on the theme modifications. But in most of cases custom changes should be saved. > Can I overwrite the function from my custom functions plugin? I don't know how the plugin you're referring to works but most probably the fix will not work in this case. Thank you, Olivia
lama
1 Posts
lama posted this 4 weeks ago

I can confirm I have the same issue as OP. In my theme I have option box with auto add paragraphs but only in Pages not in Posts. I have tried modifying functions.php as above but it doesn't change anything. I can not enable Theme Options Box in Post. Some posts have wpautotop and some are ignoring paragraphs.

I can confirm I have the same issue as OP. In my theme I have option box with auto add paragraphs but only in Pages not in Posts. I have tried modifying functions.php as above but it doesn't change anything. I can not enable Theme Options Box in Post. Some posts have wpautotop and some are ignoring paragraphs.
Support Team
Support Team posted this 4 weeks ago

Hi,

The issue reported in this topic is related to the custom post types only and will be fixed in the next Themler update.

Thank you,
Olivia

Hi, The issue reported in this topic is related to the *custom post types* only and will be fixed in the next Themler update. Thank you, Olivia
You must log in or register to leave comments