
-
AuthorPosts
-
March 19, 2020 at 5:02 pm #1194454
Hi,
Is it possible to create a template page for my portfolio items only using shortcodes?March 19, 2020 at 8:42 pm #1194579Hey paoluccimarketing,
Could you please attach a mockup of what you’re trying to achieve?
Best regards,
VictoriaMarch 19, 2020 at 9:25 pm #1194602Hi Victoria, this is the code I’m testing now. It works but I don’t know if it can crash for some element like color section etc.
<?php /* Template Name: Hotel Template */ if ( ! defined('ABSPATH') ){ die(); } global $avia_config; /* * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory. */ get_header(); if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title(); do_action( 'ava_after_main_title' ); ?> <?php global $wpdb; $title_name = $wp_query->queried_object->post_name; $customers = $wpdb->get_results("SELECT * FROM wp_misano_place WHERE name_control='$title_name'"); ?> <div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'> <div class='container'> <main class='template-page template-portfolio content <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content','post_type'=>'portfolio'));?>> <div class='test'> <?php foreach($customers as $customer){ ?> <center><?php echo $customer->name; ?></center> <center><?php echo $customer->telephone; ?></center> <center><?php echo $customer->email; ?></center> <center><?php echo $customer->address; ?></center> <center><?php echo $customer->image_link; ?></center> <?php } ?> <?php echo do_shortcode('[av_textblock size="" font_color="" color="" av-medium-font-size="" av-small-font-size="" av-mini-font-size="" av_uid="av-k7yxfp65" custom_class="" admin_preview_bg=""]'.$title_name.'[/av_textblock]'); ?> </div> <?php /* Run the loop to output the posts. * If you want to overload this in a child theme then include a file * called loop-page.php and that will be used instead. */ $avia_config['size'] = avia_layout_class( 'main' , false) == 'entry_without_sidebar' ? '' : 'entry_with_sidebar'; get_template_part( 'includes/loop', 'portfolio-single' ); ?> <!--end content--> </main> <?php //get the sidebar $avia_config['currently_viewing'] = 'page'; get_sidebar(); ?> </div><!--end container--> </div><!-- close default .container_wrap element --> <?php get_footer();
March 19, 2020 at 9:28 pm #1194604I also have another question. If my code works for my purpose, is it possible create different template for portfolio items and set the template for each portfolio item?
March 24, 2020 at 5:53 am #1195648Hi paoluccimarketing,
We apologize for the delayed response.
Based on the code you have posted, I don’t see it causing any issues or conflict with other elements such as Color Section.
As for your last question, if you’re looking for something like choosing a Page Template then, unfortunately, I don’t think that’s possible at least from what I know based on the WP Codex: https://codex.wordpress.org/Function_Reference/register_post_type (if this is possible I’ll be glad to know as well).
For now, I think the solution is to use single-{post-type}.php file as your single template and the workaround for the different templates is to use Conditional Tags to identify which portfolio items should use this layout and for the rest use this layout, etc.
Hope this is helpful.Best regards,
NikkoMarch 26, 2020 at 10:31 am #1197987Tranks Nikko for your answer.I’m using the Conditional Tags as you said but now I have two problems.
Mansory Gallery doesn’t accept link to images but works with ids and I think that every image has an id but I can’t found it. I must store any information about a place in a custom database. Is there a way to do it?
[av_masonry_gallery ids="25810,25805,25800,25795,25790,25785" caption_elements="none" caption_styling="" caption_display="always" size="fixed" orientation="" gap="1px" columns="3" av-medium-columns="" av-small-columns="" av-mini-columns="" items="24" paginate="none" color="" custom_bg="" overlay_fx="" animation="active" container_links="active" id="gallery" custom_class="" av_uid="av-k6w4d39r"]
Color section can’t get the url from $link_image_cs. echo $link_image_cs; print the correct url. Here is the code:
echo do_shortcode('[av_section min_height="50" min_height_pc="25" min_height_px="500px" padding="default" custom_margin="0px" custom_margin_sync="true" color="main_color" background="bg_color" custom_bg="" background_gradient_color1="" background_gradient_color2="" background_gradient_direction="vertical" src="'.$info->image_cs.'" attachment="25785" attachment_size="full" attach="scroll" position="center center" repeat="stretch" video="" video_ratio="16:9" overlay_enable="aviaTBoverlay_enable" overlay_opacity="0.3" overlay_color="#000000" overlay_pattern="" overlay_custom_pattern="" shadow="no-border-styling" bottom_border="no-border-styling" bottom_border_diagonal_color="#333333" bottom_border_diagonal_direction="" bottom_border_style="" custom_arrow_bg="" id="" custom_class="" aria_label="" av_element_hidden_in_editor="0" av_uid="av-jgp3h75a"]');
-
This reply was modified 5 years, 3 months ago by
paoluccimarketing.
March 26, 2020 at 5:36 pm #1198133I understood the problem and it’s the same for both. I found the id for each image. For color section I passed in the attachment the id of the image. But now there is another problem: the page I’ve created with the enfold layout is different using only shortcodes.
How is it possible?-
This reply was modified 5 years, 3 months ago by
paoluccimarketing.
March 28, 2020 at 5:31 pm #1198645Hi paoluccimarketing,
Thanks for giving us access.
I can’t really give an answer why it’s different but can you try to wrap the Masonry instead inside a Content Layout element.
Maybe that could fix it since it seems to be wrapping inside the same section as those 1/3 columns.Best regards,
NikkoMarch 28, 2020 at 7:53 pm #1198666Hi nikko,
Thanks for your answer. I tried what you said but nothing is changed.March 28, 2020 at 7:54 pm #1198667Hi nikko,
Thanks for your answer. I tried what you said but nothing changed.March 30, 2020 at 8:42 am #1199013Hi paoluccimarketing,
Thanks for giving us admin access.
I was able to check the backend however if I go to Appearance > Editor > single-portfolio.php it’s empty.
Can you give us ftp access? so we can try to do some modification, it seems like the color section breaks the layout in the footer.Best regards,
NikkoMarch 30, 2020 at 9:18 am #1199019Hi nikko.
Thanks for your answer.
Here the ftp access.April 2, 2020 at 11:58 am #1200120Is there anyone who can help me?
April 3, 2020 at 8:54 pm #1200619Hi paoluccimarketing,
We apologize for the delay, some shortcodes doesn’t work properly when it’s outside of the template builder.
I have modified the single-portfolio.php file but you will need to modify the dynamic values.
Here are some things that’s not working when using a shortcode:
– [av_postcontent]
– Equal height columns does not work well outside the template builder
Also you have 4 foreach loops and they are on top of each other that’s why it’s repeating multiple times, you’ll need to store those values and keep the shortcode outside of the loops unless you want them to be repeated.Best regards,
NikkoApril 4, 2020 at 10:31 am #1200775Hi nikko,
Thank you very much for everything you’ve done. It’s awesome now. These days I’ll try to modify informations of the page.
– How can I store those values? I found only foreach loops method to print all values.
– I don’t want repeated elements on the page but how I wrote here (“https://kriesi.at/support/topic/sql-query-problems/”) I can’t use the word “AND” to select only one element.
– Seems not works on mobile phone. Is it a problem of shortcodes, isn’t?April 6, 2020 at 9:40 pm #1201388Hi paoluccimarketing,
I think you can run those loops and just store those values you need in some variable (make sure you initialize those variables outside the loop)
Then you can use the shortcode and replace the contents with the correct variables.
Hope this helps.Best regards,
NikkoApril 13, 2020 at 8:06 pm #1203336Hi nikko,
Thank you for helping me.April 13, 2020 at 11:25 pm #1203376Hi,
Did you need additional help with this topic or shall we close?
Best regards,
Jordan ShannonApril 30, 2020 at 12:00 pm #1208486Hi Jordan,
sorry for the delay of this answer. I resolved all my problems but the iframe doesn’t work in the “av_button_big”. I have two buttons that do the same thing but only the first one works right while the second one opens the url in another page. The button that doesn’t work is at the bottom of the page.Best Regards
-
This reply was modified 5 years, 2 months ago by
paoluccimarketing.
April 30, 2020 at 5:42 pm #1208574Hi,
So you need the button to open in an iframe?
Best regards,
Jordan ShannonApril 30, 2020 at 9:41 pm #1208645Exactly.
Like the first button do.April 30, 2020 at 10:18 pm #1208657Hi,
The login info provided did not work for me. Can you please check?
Best regards,
Jordan ShannonMay 5, 2020 at 12:09 pm #1209903Hi Jordan,
Sorry for the wrong info.-
This reply was modified 5 years, 1 month ago by
paoluccimarketing.
May 15, 2020 at 1:24 pm #1213267Hi,
Sorry for the late reply, I see the “RICHIEDI PREVENTIVO” button at the top of your page opens an iframe to a blank page, if you try to load the page directly it leads to a “500 internal error”, so I would say that your error is with the content of the page and not so much the iframe. What is supposed show on the page, a shortcode for a plugin?Best regards,
MikeMay 16, 2020 at 9:43 pm #1213665Hi Mike,
Currently the server is having some troubles due to a plugin we installed but it should open a contact form. Is it possible to open the same iframe in the second button?May 16, 2020 at 10:35 pm #1213669 -
This reply was modified 5 years, 3 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.