Forum Replies Created

Viewing 30 posts - 61 through 90 (of 235 total)
  • Author
    Posts
  • in reply to: Magnificent popup is not a function #1298601

    Yes I use a child theme (mmpatf). The magnificent popup function is called from the functions.php file. Many other snipets you may see on the page are customed: some are written on the template page and many others are called from a subfolder within the child theme that contains the whole programming code for the OpenLayers map. Everything is arranged from coding (there’s almost nothing on the enfold back-end)

    At first I thought that some javascript was conflicting with the popup, but I have an exact copy of the page on my computer an it works. The only difference is that either WP and Enfold are not updated at the last version as it is online.

    in reply to: Magnificent popup is not a function #1298578

    Sorry @Guenni007 but I tried: nothing worked. Any other suggestion?

    in reply to: Magnificent popup is not a function #1298530

    @Guenni007 I’m not sure. On the local version (MAMP) of the website which contains the same plugins, everything is working fine. I tried to de-activate however WP Download manager which has some popup javascript that may be in conflict, but nothing happened. The problem is still there

    in reply to: Magnificent popup is not a function #1298504

    Hi @Guenni007. yes the “Lightbox Modal Window” is checked. I now just uploaded the page template where I activated the html for the window I need. It’s the link you find at the right-bottom corner of teh page (Definitions-> when you click on the word a popup should come out). The style sheet is a specific one named “immas-style.css” and the function is written in the functions.php of my child theme

    function popup_inline() { ?>
    <script type="text/javascript">
    
    //.on('load') is used when jQuery migrate is disabled
    jQuery(window).on('load', function () {
        jQuery('.open-popup-link').magnificPopup({
            type:'inline',
            midClick: true,
            closeBtnInside:true
        });
    });
    
    </script>
    <?php 
    }
    add_action('wp_footer', 'popup_inline');

    I solved the problem! Sorry for bothering. The correct way to show a shortcode is to use $output and return it, as the following code

    function single_map (){
    $indirizzo = get_field('indirizzo');
    $type_icon = 'http://localhost:8888/mario/wp-content/themes/yaiv/images/marker-home.png';
    
    $output = '<div class="acf-map" style="overflow: hidden; position: relative;">';
    if( $indirizzo ): 
    $output .= '<div class="marker" data-lat="';
    $output .= esc_attr($indirizzo['lat']).'"';
    $output .='data-lng="';
    $output .= esc_attr($indirizzo['lng']).'" ></div>"';
    endif;         
    $output .= '</div>';    
    return $output;
    }
    add_shortcode( 'single_map', 'single_map' );

    Hence you can close the ticket (maybe the code is useful to somebody else)

    Yes please close the topic!

    in reply to: Background video in color section is mute #1270898

    Thanks Yigit! Your solution did the trick! Topic solved.

    in reply to: Background video in color section is mute #1270197

    Thanks Guenni007, I actually did change my settings in the browser, allowing video and audio. However still the sound is not played. I tried with Firefox Chrome and Safari, and still the audio is not audible.

    in reply to: Background video in color section is mute #1270134

    Hi Ismael, have you had the possibility of checking my issue above? I posted in the private session the ftp access as you requested. Thanks a lot

    Thanks Ismael, I will check the two articles you mentioned!

    in reply to: Background video in color section is mute #1268995

    Hi Ismael I tried your solution but it’s still not working. Actually the client doesn’t care if there are no controls available to stop/re-play the video, as the video should be only appear in the home page which works as an intro. So it is juts to have a background video going on, but he really wants to let the audio playing as well.

    Another soluton it would be to embed the video in a classical slide, but I don’t know if it is possible to make show it as a full page video with text elements in it as it is now (the reference page is in the private section)

    in reply to: Background video in color section is mute #1268430

    Ok I don’t understand. I use Firefox, but now I tried with Chrome as well. Although audio is enabled via functions.php, AND I have interacted with the domain (click) OR the video with sound has been previously played with sound, I still don’t hear anything.

    Also the same thing happens if I add a direct link to the .mp4 uploaded to my server.

    Is there any method to bypass the issue? My client wants specifically a video he created (the one that is in the link you received) which has sound.

    Thanks for help

    in reply to: Background video in color section is mute #1268061

    Thank you. Find here link and credentials

    Thanks Ismael!! Sorry for the late reply. The problem is solved! I understand now where was the problem.
    you can close the ticket now.
    Great support as usual!

    Ok in the private section I am going to add all the information you need to access my files

    • This reply was modified 4 years, 1 month ago by elenapoliti.

    Yes I removed the archive-projects.php but nothing happened. Give me one hour to upload the web site to a temporary domain so that you can access. I will give you the access details and specify the pages. Thanks

    Hi Ismael, unfortunately your code didn’t work. I still see my projects listed as a list instead of a blog grid. It seems that notwithstanding the filter avf_blog_style, the settings in the theme options overwrite everything

    Hi Ismael, sorry for the late reply but I was ways the whole week.
    I did two attempts following your suggestions, but didn’t work. Here the code for each one.
    First of all I created a blog page where the standard post should be visible, and I set the child theme options for blog layout as a list (that’s how I want to see my standard post). Now the idea is that if I select a specific term taxonomy from the custom type posts (projects) I want them shown in a grid format.
    Here my two attempts to do it.

    ATTEMPT 1
    I used the is_post_type_archive function within the archive-project.php, simplifying it for my purposes:

     //above there's the code for handling the header, which I didn't change
    		<div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'>
    			<div class='container template-blog '>
    				<main class='content <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content','post_type'=>'post'));?>>
    					<?php 
    						$tds =  term_description(); 
    						if($tds)
    						{
    							echo "<div class='category-term-description'>{$tds}</div>";
    						}
    					?>
                        <?php
                        if ( is_post_type_archive( 'projects' ) ) {
              				global $posts;
                            $post_ids = array();
                            foreach($posts as $post) $post_ids[] = $post->ID;
                            if(!empty($post_ids))
                            {
                                $atts   = array(
                                    'type' => 'grid',
                                    'items' => get_option('posts_per_page'),
                                    'columns' => 5,
                                    'class' => 'avia-builder-el-no-sibling',
                                    'paginate' => 'yes',
                                    'use_main_query_pagination' => 'yes',
                                    'custom_query' => array( 'post__in'=>$post_ids, 'post_type'=>get_post_types() )
                                );
    							/**
    							 * @since 4.5.5
    							 * @return array
    							 */
    							$atts = apply_filters( 'avf_post_slider_args', $atts, 'archive' );
                                $blog = new avia_post_slider( $atts );
                                $blog->query_entries();
                                echo "<div class='entry-content-wrapper'>".$blog->html()."</div>";
        					}
                       
                        ?>
    				<!--end content-->
    				</main>

    ATTEMPT 2
    I still have an archive-projects.php which is the exact copy of archive.php
    I added to my functions.php the following code:

    add_filter('avf_blog_style','avia_change_category_blog_layout_2', 10, 2); 
    function avia_change_category_blog_layout_2($layout, $context){
    if($context == 'archive-projects') $layout = 'blog-grid';
    return $layout;
    }

    In all 2 attempts, the blog layout (list) set in the child theme options overwrites the codes for the archive-projects.php. So if I click on a term taxonomy of the custom type posts, they appear as a list, like the blog page instead of appearing as a grid.
    Could you help me please?

    • This reply was modified 4 years, 1 month ago by elenapoliti.
    in reply to: How to set a calculated date to filter blog posts #1246215

    Thanks it worked! I included the condition if(is_archive()) as follows, and everything is back to normal

    add_filter('avia_post_slide_query', 'avia_post_slide_query_mod',10, 2);
    function avia_post_slide_query_mod($query, $params) {
    	$posts = get_posts($query);
    	$today_year = date('yy');
    	$two_years_ago = $today_year - 2;
    	$current = array();
    
    		foreach( $posts as $post ) {
    			$meta = get_post_meta($post->ID);
    			$acf_year = $meta['anno'][0];
    			
    			if (is_page(112)){
    				if($acf_year >= $two_years_ago & $acf_year <= $today_year) {
    				$current[] = $post->ID;
    				}	
    			}
    			else if (is_page(204))	{
    				if($acf_year < $two_years_ago) {
    				$current[] = $post->ID;
    				}	
    			}
    			else if (is_archive()) {
    				return $query;
    			}
    		}
    
    	$query['post__in'] = $current;
    
    	return $query;
    }

    You can close the ticket. Thanks

    in reply to: How to set a calculated date to filter blog posts #1245782

    Hi Ismael, I got it. The code I used is as follows (I put it in the functions.php). However I got into a new problem:

    My two pages, have the content element ‘blog posts’ where I show all the categories. Programatically by the below code the two pages show different posts according to the acf field = year (anno)

    If however I click on the category link (hence filter by category) the category archive is mess up. I checked and something in the function below enters in conflict with the category archive. Do you have any suggestion?

    I copy in the private section the link to the test page

    add_filter('avia_post_slide_query', 'avia_post_slide_query_mod',10, 2);
    function avia_post_slide_query_mod($query, $params) {
    	$posts = get_posts($query);
    	$today_year = date('yy');
    	$two_years_ago = $today_year - 2;
    	$current = array();
    		foreach( $posts as $post ) {
    			$meta = get_post_meta($post->ID); //acf fields are saved in post meta
    			$acf_year = $meta['anno'][0]; //get the value of the field needed (anno=year)
    			if (is_page(112)){
    				if($acf_year >= $two_years_ago & $acf_year <= $today_year) {
    				$current[] = $post->ID;
    				}	
    			}
    			else if (is_page(204))	{
    				 if($acf_year < $two_years_ago) {
    				$current[] = $post->ID;
    				}	
    			}
    		}
    	$query['post__in'] = $current;
    	return $query;
    }
    • This reply was modified 4 years, 2 months ago by elenapoliti.
    in reply to: How to set a calculated date to filter blog posts #1245704

    Thanks Ismael, but I am still a bit confused. My custom field is a simple year, which appears on each post (ex. 2018, 2020 etc.). I should organize my blog posts on the two pages according to that field. On one page there should be automatically all posts that have a year comprised between the present (hence getting a timestamp like $today = getdate(); to allow a calculation) and maximum 2 years past , and the other page should contain all the posts up to 2 years ago (always according to the custom field and not the post date publication).
    Something like the following

    $today= getdate();
    $today_year = $today['year'];
    $two_years_ago = $today_year - 2;
    if (is_page (204)) {
      if ($today_year >=$custom_field_value >= ($today_year  - $two_years_ago)) 
      {show the posts}
    }
    else if (is_page (304)) {
     if ($custom_field_value <($today_year  - $two_years_ago) {show the posts}
    }

    My difficulty is:
    1) how to filter custom field value
    2) how to show the posts that satisfy the request

    • This reply was modified 4 years, 2 months ago by elenapoliti.
    in reply to: How to set a calculated date to filter blog posts #1244967

    Thanks Ismael. Just one question: in order to pass the new array as a WP query where the array is built as you suggest $date_query = your_array();
    should I use $date_query = AviaHelper::add_date_query( $date_query);
    or should I use $query = new WP_Query( $date_query ); ?

    And, if I have a custom field named “year” in which I actually write the year of the post (not the year when the post is published) can I still use the
    $query = new WP_Query( $args ); within the postslider.php? Because maybe I can simply use the custom field to filter the posts

    Thanks

    in reply to: How to set a calculated date to filter blog posts #1244600

    Hi, have you any suggestion for the question above? Thanks very much

    in reply to: How to deregister enfold scripts in a specific page #1225456

    Thanks Ismael. usually I manually disable the template builder elements as in the past the “Load only used elements” options was crashing some pages. However I tried it now and its works. Still there are a few css / scripts that I don’t need on this specific page, but thanks for pointing out where I can find those!

    in reply to: How to deregister enfold scripts in a specific page #1224078

    Hi do you have any suggestion for the above topic? Thanks a lot

    Great @guenni007, it’s a good compromise! I just put it in the functions.php with a conditional setting on which page the function should be triggered and it works.

    Thanks @Guenni007, I have read about codes to limit excerpt content. I could work it out with a custom ACF field, but I wanted to render everything in the advanced layout builder. The specific page, where I need it, is made by 3 flex columns simply containing title + textblock + image. In order to have everything nicely ordered at the same height, the idea was to, somehow, limit the amount of text the client can add to the textblock. I wonder however (I am not an expert of ACF) if I can use a multiple ACF just on a single page .

    in reply to: Use of Search&Filter Pro with blog posts #1218707

    Thanks Ismael, I am sorry for having left this ticket open. I solved the problem with Search&Filter.

    For future reference, I created a filtering form with S&F. Then I added the form to a widget (with the plugin in the widget area it appears the S&F). In the 1/5 column I added the widget just created. The trick was adding a further shortcode just after that, simply as text :
    [searchandfilter id=”243″ action=”filter_next_query”]

    In this way the plugin can filter the blog grid with an ajax request, in a similar way to what happens with the masonry filter.

    You can close the ticket. Thanks

    in reply to: image container forced at the bottom of a flex column #1218159

    Hi Guenni007 your solution worked as charm!! I am not so familiar with flexbox, hence thanks also for the guide you posted in your link. I will study it.
    Problem solved!

    Maybe it’s better that I open a new ticket for my question above

Viewing 30 posts - 61 through 90 (of 235 total)