
-
AuthorPosts
-
July 23, 2021 at 10:04 am #1311775
I have got very simple overriden single.php code which is copying layout from a specific post ID. Problem is that new layout is not rendering the same. I have a section split into 2 50% columns which is not rendering properly and also the page padding is not the same. I have included the 2 referring links in the private notes. Please help!
<?php if ( !defined('ABSPATH') ){ die(); } global $avia_config; get_header(); $post_id = 1357; $shortcode = apply_filters('avia_builder_precompile', get_post_meta($post_id, '_aviaLayoutBuilderCleanData', true)); $shortcode = apply_filters('the_content', $shortcode); echo $shortcode; get_footer();
July 25, 2021 at 10:03 am #1312188BUMP
July 26, 2021 at 3:35 am #1312273Can somebody help please?
July 26, 2021 at 6:27 am #1312300Hi,
Thank you for the inquiry.
We checked the site but we cannot see any issue with it. Would you mind providing a screenshot of the issue?
Best regards,
IsmaelJuly 26, 2021 at 9:56 pm #1312529Hi Ismael
I didn’t get a reply for a few days so I reverted the code to try to look for another solution. I have put it back now for you to see. Please try those links again.
Also, please let me explain what I am trying to achieve here in case there is an easier solution available you can suggest?? Or at least so that you can understand why I am doing this.
I am trying to build a web design ‘template’ layout that I can then apply to all post pages with a specific custom post type. The idea is that the layout will be the same for all the pages with the custom post type, it is just some of the content within the layout will be different according to which specific post ID I am looking at. For example, the page title will be dynamic and will show the post title, and the description box underneath will show the meta description from the post ID etc.
The problem that I am facing is that there will be a LOT of these pages and it is highly likely that the client will be continuously requesting changes and enhancements to the layout, so copying and pasting this layout manually is really not an option. So I determined the best solution was to create a single layout, then to copy this layout to the other pages and dynamically find and replace the content sections before rendering it to make the content areas dynamic. So for example on my master layout page I could change the title to **TITLE** something like this so that I could easily find and replace it in code. (I understand I could use shortcode for this but couldn’t get this to work for the heading blocks in ALB when I tried to insert shortcode so I resolved to do this manually instead in code?).
My solution therefore was to enable the ALB editor for custom post types then to use ALB to design the layout for one specific post ID, then copy this layout to all other pages with that post type using the code I provided above, whilst doing the find and replace to dynamically update the content areas..
However after running the code I pasted above I can see that the layout is not the same on the pasted page.
Again, it could be that there is an easier solution you can suggest here, if so please let me know.
Please check the private files on this reply I have also attached screenshots here as requested.
Thanks in advance.
July 28, 2021 at 1:46 am #1312878BUMP AGAIN
July 29, 2021 at 11:20 am #1313212Hi,
Sorry for the delay. There is an element called Page Content where you can select a specific page and display the content of that page on other pages. You could also save the content of a page as template and reuse it elsewhere. Have you tried those features yet?
And if you want to globally modify an element and create a custom element base on another, the theme also has the Custom Elements Templates. Please check the following documentation for more info.
// https://kriesi.at/documentation/enfold/custom-element-templates/
We still cannot see the issue on the pages that you posted above. Did you revert it back again?
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.