Skip Navigation

[Resolved] Custom Layout not displaying on front-end

This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 4.00 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 7 replies, has 2 voices.

Last updated by Nigel 7 years ago.

Assisted by: Nigel.

Author
Posts
#592488
Screen Shot 2017-11-23 at 12.15.48 pm.png
Screen Shot 2017-11-23 at 12.16.08 pm.png
Screen Shot 2017-11-23 at 12.16.14 pm.png
Screen Shot 2017-11-23 at 12.14.38 pm.png

I am trying to:
Display my custom post type with custom taxonomies
Link to a page where the issue can be seen:
hidden link
I expected to see:
The custom layout. See imgur link here: hidden link
Instead, I got:
No layout displayed. hidden link

#592560

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Emma

Can you switch theme (to twentyseventeen, for example) and check again?

You are using the Newspaper theme and I'm not sure that it is compatible with Views and Layouts because it uses a non-standard way of rendering content in the theme template files.

If you could check that and let me know.

#592597

Hello Nigel,

Yes the layouts work on other themes; it just seems to be this one. I had to change to this theme after my old one was not working properly. Since I have a database of 4,000 movies I really don't want to go through and copy/paste shortcodes so everything displays (should Layouts not be compatible with this theme), so is there any way I could automate the process or automatically add the shortcodes to all existing custom post types?

Thanks for your help! 🙂
- Emma

#592614

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Emma

That's not really a viable option.

The reason the templates don't work with the Newspaper theme is that the theme uses something other than the_content() in its PHP templates to output the post content.

I think a better solution would be to copy the single.php template to single-movie.php (so that it will be used for all movie single posts) and then edit that template file so that where it outputs the post content you modify this to use the_content().

If you know a little PHP you can compare the templates from twentyseventeen and modify single-movie.php so that it does something similar, specifically using the_content().

If you are not able to do that let me know and I will have a look tomorrow.

#592692

Hey Nigel,

Hmm okay. If you could take a look at it that would be wonderful. I may contact the theme developers and see if they know anything about this issue. I really don't want to change themes again, but if Toolset just won't work with Newspaper I may have to.

Let me know if it seems possible!
Thanks,
Emma

#592811

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Emma

So, the culprit here I think is that the Newspaper theme uses a custom function to output the content instead of the standard the_content() which is expected by Toolset.

Here's what I suggest you try. This is for displaying single movie posts, you would need to do something similar if you had other post type templates affected. (We could simply change this universally for all single posts, but I don't want to risk breaking things on, for example, your standard WordPress posts.)

1. make a duplicate of wp-content/themes/newspaper/single.php in the same location called single-movie.php (this will be used to display Movie posts, assuming the post type slug is 'movie').
2. edit this file and locate the following line (28 in my copy)

                                locate_template('loop-single.php', true);

Change loop-single.php to loop-single-toolset.php, and save.

3. In the same folder make a duplicate of the file loop-single.php and name it loop-single-toolset.php

4. Edit the file and locate the following line (51 in my copy):

        <?php echo $td_mod_single->get_content();?>

Replace it with

        <?php the_content(); ?>

Can you try that and let me know if it displays the Layout template now?

#592854

Nigel, you are a genius. That worked perfectly! Thank you so much! It's so much better than inputting shortcodes manually 😉 You are a lifesaver.

I hate to be a bother but I have one more issue. I'm not sure if it's a Toolset issue or a theme issue. On the archive pages for my custom taxonomies created through WordPress they don't display correctly; the sidebar isn't on the side and sometimes overlaps with the content. Example (scroll up and down to see the overlapping): hidden link

Would you know anything about this? It's also totally fine if you can't help; you've been a big help already.

Thanks!

#592861

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Sorry Emma

We have a one-issue-per-ticket policy in the forum, could you please post it as a new question?

Once you accept this thread as resolved you will be able to assign the new thread directly to me if you like.