Forum Replies Created

Viewing 30 posts - 1 through 30 (of 32 total)
  • Author
    Posts
  • in reply to: advance editor keep loading #1176967

    We somehow managed to identify that the issue is caused by some configuration of the mod_security rules. So far we havent found what exact setting was blocking the loading, but we temporary disabled mod_security for testing and it worked. If we manage to find the exact setting, I’ll write it here later this week

    in reply to: advance editor keep loading #1176934

    I have already tested that and it dont fix the problem. I desactivated them all again so you can check if needed, but it doesnt work.

    I still see the same admin-ajax.php error in console

    in reply to: advance editor keep loading #1176373

    using php 7.2 is sadly not helping out.

    in reply to: product slider order by random #902946

    anyone has an idea?

    in reply to: Enfold theme showing plugin update #866552

    Appreciate this code to “hide” the issue, but a plugin not updated still a threat.

    Your theme is awesome and I also use it on few sites. Can you manage to do the layerslider updates when there are or at least put your code in the theme itself avoiding this confusing extension update notification to happen every single time you update the theme… It’s hard to explain to client how important it is to keep site updated but not to look for that notification….

    Appreciate your concern about that issue.

    • This reply was modified 7 years, 2 months ago by lepetitweb.
    in reply to: display 2 products per line on phone display #854058

    sorry for the delay, i didnt clicked the notify and missed the question. Here is the link in private content

    I kept searching and found this awesome link about adding section before the footer by using a hook on “get_footer” that will do the trick way simplier then my previous ideas. This way i can place the html i’ll want with new widget zones.

    Thanks anyway for the help

    basically make footer column 1 full width background but content centered in container class size and then other footer column to also display on next row with different background and left align inside the .container size

    in reply to: header transparency remove fade effect when scrolling #792114

    No it’s all good now thanks anyway

    in reply to: header transparency remove fade effect when scrolling #792094

    got it working by gettting the css less specific with

    #header_main{
    background-color: rgba(24,36,94,0.85);
    }
    in reply to: magazine object show same language items on all language #567403

    I created a template out of the content of home page english and loaded it in a brand new page /test/?lang=en and sadly the french content is still showed

    yes you are allowed to do what you want to help find and correct the issue

    in reply to: magazine object show same language items on all language #565581

    Sadly desactivating all other extensions didn’t worked either.

    Here are the credentials in the private section

    Thanks in advance to help me with this trouble

    in reply to: Event calendar pages add layerslider at top #550241

    here are the informations

    in reply to: google map recenter on links #548201

    with the new update to the google map api, is it now possible to hook a recenter map on a link in the page?

    in reply to: google map recenter on links #541866

    my code will not work with defaut wordpress theme since I use a enfold object (your google map object)… All i want is being able to place a link in the page to recenter your google map object on a marker address.

    I can replace your google map shortcode by my personnal google map code, but since your object is good and already adapted to the theme, I wanted to use it… I just can’t find the javascript objet that I can call action on to make it recenter like in this code:

    map.setCenter(new google.maps.LatLng(10.23,123.45));

    The “map” should be the name of the google map object that we can call methode on…

    Thanks in advance for your help

    in reply to: google map recenter on links #536886

    Ok thanks for the upcoming help.

    To makes it more clear…

    I have a page where I list companies on a map and on a list below the map. I want to put a link on each companies on the bottom listing who make the map over it center on that company marker on the map

    Presently, I only putted an alert in the onclick of the companies listing where I want to make the link to recentering the map

    in reply to: hook on contact form element #525579

    thanks a lot link is exactly what i wanted.

    in reply to: basic template #524671

    found it… kinda stupid of me…

    I only had to use the page.php in enfold folder as template sample since it’s for pages…

    Thanks for the help tho

    in reply to: hook on contact form element #524538

    great what would be the hook for modifying the email content??

    A very little sample just like the 1 you sent would be exactly what i am looking for!!!

    Thanks a bunch

    in reply to: basic template #524517

    no I simply want a very simple template who is going to display pages like normal template but that i can use on my developpement template

    in reply to: add html to the top of each single page of portfolio #496026

    Hi and thanks to have had a look at my question.

    We have 568 portfolios in french and english languages so over 1100 at total… the header we want to add will change from time to time so we dont want to have to change each portfolio 1 by 1 using the builder…

    Anyway the way i done it works… It’s kinda dirty but it does work and i’ll keep it like that then

    Thanks for your help

    in reply to: add html to the top of each single page of portfolio #494523

    i want to add a slideshow and a short text block below the breadcrumb bar. I dont want to have to change it on all portfolio if it change so i want it to be in the portfolio single page template.

    I actually achieved to do it in a dirty way a few mins ago after finding more info on the forum

    I added this code in template-builder.php

    if (is_singular('portfolio')){
    	$laposition = strpos($content, "'container'");
    	$temp = substr($content, 0, $laposition-11);
    	$temp .= do_shortcode("[av_layerslider id='99']");
    	$temp .= substr($content, $laposition-11, strlen($content));
    	$content = $temp;
    }
    echo $content;
    

    Finding a string in the content, targeting the spot where i want my stuff and then insert my content in it, but there must be a cleaner way to do it, maybe with a hook or a filter

    in reply to: Add portfolio by php script #475057

    thx for the answer.

    I posted my whole code only for user reference later. The exact problem i deal with is the following :

    When i insert portfolio everything works fine. I have post, featured image, category, tags working. But i think i miss some meta post data cause when i display the portfolio it doesnt looks right like other post (featured image at top, tag showing at footer and css messed up). After that if i just go to the portfolio page and hit save button without any modification, it display correctly because the wordpress UI must assign the right meta post.

    So the exact instruction i need who be how to call a function that would generate the appropriate meta post data because if i just try to set them exactly like my template portfolio it’s doesnt work good either

    in reply to: Add portfolio by php script #474002

    someone could have a look at this thread please? 1st feedback was really fast but need a little help to end my script

    in reply to: Add portfolio by php script #473312

    No Ideas?

    in reply to: Add portfolio by php script #472627

    any Idea about how to generate the post_meta like if i clicked update on the admin ? There must be a function i can call to generate the right value… It’s the only thing who’s not working in my whole import script… Wish you can help me with this.

    Thanks in advance

    in reply to: Add portfolio by php script #472433

    here is the basis for my import portfolio script from a csv… Still needing to figure out what’s wrong from post_meta as explained in my last message

    
    <?php 
    session_start(); 
    error_reporting(E_ALL-E_NOTICE);
    ini_set('display_errors', '1');
    ini_set("memory_limit","500M");
    ini_set('max_execution_time',500);
    require_once($_SERVER['DOCUMENT_ROOT'].'/wp-load.php');
    
    global $wpdb;
    
    function csv_split($line,$delim=';',$removeQuotes=false) { 
    	$fields = array(); 
    	$fldCount = 0; 
    	$inQuotes = false; 
    	for ($i = 0; $i < strlen($line); $i++) { 
    		if (!isset($fields[$fldCount])) $fields[$fldCount] = ""; 
    		$tmp = substr($line,$i,strlen($delim)); 
    		if ($tmp === $delim && !$inQuotes) { 
    			$fldCount++; 
    			$i += strlen($delim)-1; 
    		} else if ($fields[$fldCount] == "" && $line[$i] == '"' && !$inQuotes) { 
    			if (!$removeQuotes) $fields[$fldCount] .= $line[$i]; 
    			$inQuotes = true; 
    		} else if ($line[$i] == '"') { 
    			if ($line[$i+1] == '"') { 
    				$i++; 
    				$fields[$fldCount] .= $line[$i]; 
    			} else { 
    				if (!$removeQuotes) $fields[$fldCount] .= $line[$i]; 
    				$inQuotes = false; 
    			} 
    		} else { 
    			$fields[$fldCount] .= $line[$i]; 
    		} 
    	} 
    	return $fields; 
    } 
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Document sans titre</title>
    </head>
    
    <body>
    <?php 
    //////////////////////////////////////////
    // get detail from an existing portfolio... works like a template...
    //////////////////////////////////////////
    $page_id = 10534; // specific Page's id from your site, which you can find by mousing over the link to edit that Page on the Manage Pages admin page. The id will be embedded in the query string of the URL, e.g. page.php?action=edit&post=123.
    $page_data = get_page( $page_id ); 
    echo "<pre>"; print_r($page_data); echo "</pre>";
    $page_post_tags = wp_get_post_tags($page_id);
    echo "<pre>"; print_r($page_post_tags); echo "</pre>";
    $meta_values = get_post_meta( $page_id );
    echo "<pre>"; print_r($meta_values); echo "</pre>";
    //echo apply_filters('the_content', $page_data->post_content); // echo the content and retain WordPress filters such as paragraph tags.
    
    // get the featured image 
    //$limage = wp_get_attachment_image_src( get_post_thumbnail_id( $page_id ), 'single-post-thumbnail' ); 
    //echo "<pre>"; print_r($limage); echo "</pre>";
    
    // Get all the portfolios categories list
    $args = array(
        'orderby'           => 'name', 
        'order'             => 'ASC',
        'hide_empty'        => false, 
    ); 
    $tax_terms = get_terms('portfolio_entries', $args);
    //echo "<h2>Terms:</h2> <pre>"; print_r($tax_terms); echo "</pre>";
    
    // get the categories for a specific portfolio item
    //$product_terms = wp_get_object_terms( $page_id, 'portfolio_entries' );
    //echo "<pre>"; print_r($product_terms); echo "</pre>";
    
    //////////////////////////////////////////
    // Read CSV file and put it in a array of lines column
    /////////////////////////////////////////
    $datas = array();
    $contenu = file("capsules.csv");
    $the_limite = 2; //Number of line read max... if higher then number of line in file it will just get all line
    
    $liste_full = array();
    if (is_array($contenu)){
    	$x = 0;
    	$compteur = 0;	
    	foreach ($contenu as $line){
    		if ($x > 0 && $x < $the_limite + 1){
    			// Traitement pour problème d'accent avec excel
    			$line = trim(iconv("Windows-1252", "UTF-8", " ".$line." "));
    			// Découpage de la ligne en champs
    			$data = csv_split($line,';',true);
    			// Si c'est pas une ligne vide on l'ajoute a notre tableau
    			if (!empty($data[0])){
    //					$liste_full[] = strtolower($data[0]);
    				$liste_full[] = $data;
    			}
    		}
    		++$x;
    	}
    	echo "<p>Liste full de ".$x. " items</p>";
    }	
    
    // List of detail lines from csv file
    // We have 1 line per language and i reverse the array to get the main language first for each portfolio
    $liste_full = array_reverse($liste_full);
    echo "<pre>"; print_r($liste_full); echo "</pre>"; 
    
    // LOOP all item in the list to add portfolios pages
    $trid = 0;
    foreach($liste_full as $line){
    	
    	// Filling some variables
    	$tags = $line[8]; // List of tags for the portfolios
    	$image_url = "images_capsules/".$line[2]; // URL of the picture for featured image
    	$category_letter = strtoupper(substr($line[0], 0, 1));
    	$array_category_name = array("VIDEO", $category_letter); // List of exact category names to add to this portfolio case sensitive
    
    	// Replacement for the Template tags from data from csv
    	$content = $page_data->post_content;
    	$content =  str_replace("{{TITLE}}", $line[0], $content );	
    	$content =  str_replace("{{LINK_IMAGE}}", $line[2], $content );	
    	$content =  str_replace("{{LINK_CAPSULE}}", $line[4], $content );	
    	$content =  str_replace("{{LINK_FILE}}", $line[5], $content );	
    	$content =  str_replace("{{DESCRIPTION}}", $line[7], $content );	
    		
    	// filling post basic data
    	$page = array();
    	$page['post_type']    = 'portfolio';
    	$page['post_title']   = $line[0];
    	$page['post_content'] = $content;
    	$page['post_excerpt'] = $line[3];
    	$page['post_parent']  = 0;
    	$page['post_author']  = 1; // $user_ID;
    	$page['post_status']  = 'publish';
    
    	//Add page
    	$pageid = wp_insert_post ($page);
    	if ($pageid == 0) { // Add Page Failed 
    		echo "<h2>Error while creating the page with title : ".$line[0]."</h2>";
    	}
    
    	// if main language post get the TRID for the WPML link
    	if ($line[6] == "FR"){
    		$results = $wpdb->get_results( 'SELECT * FROM wpdb_icl_translations where element_id = '.$pageid, OBJECT );
    		foreach ($results as $row){
    			$trid = $row->trid;
    		}
    	// if second lang, we update the date in icl_translations
    	} else {
    		$wpdb->query( 'UPDATE wpdb_icl_translations SET source_language_code = "fr", language_code = "en", trid = '.$trid.' where element_id = '.$pageid.' AND element_type="post_portfolio"' );
    	}
    
    	// apply tags to the portfolio
    	wp_set_post_tags( $pageid, $tags, false ); // tags separé par , last item true = add false = replace 
    
    	//Set featured image
    	if ($line[6] == "FR"){ // Insert the image only for main language since image will be same for both language
    		$upload_dir = wp_upload_dir();
    		$image_data = file_get_contents($image_url);
    		$filename = basename($image_url);
    		if(wp_mkdir_p($upload_dir['path'])){
    			$file = $upload_dir['path'] . '/' . $filename;
    		} else {
    			$file = $upload_dir['basedir'] . '/' . $filename;
    		}
    		file_put_contents($file, $image_data);
    		
    		$wp_filetype = wp_check_filetype($filename, null );
    		$attachment = array(
    			'post_mime_type' => $wp_filetype['type'],
    			'post_title' => sanitize_file_name($filename),
    			'post_content' => '',
    			'post_status' => 'inherit'
    		);
    		$attach_id = wp_insert_attachment( $attachment, $file, $pageid );
    		require_once(ABSPATH . 'wp-admin/includes/image.php');
    		$attach_data = wp_generate_attachment_metadata( $attach_id, $file );
    	}
    	wp_update_attachment_metadata( $attach_id, $attach_data );
    	set_post_thumbnail( $pageid, $attach_id );
    	
    	// Set portfolio categories
    	$list_cat = array();
    	foreach ($tax_terms	as $taxo){
    		if (in_array($taxo->name, $array_category_name)){ $list_cat[] = $taxo->term_id; }
    	}
    	$list_cat = array_map( 'intval', $list_cat );
    	$list_cat = array_unique( $list_cat );	
    	$term_taxonomy_ids = wp_set_object_terms( $pageid, $list_cat, 'portfolio_entries', true );
    	if ( is_wp_error( $term_taxonomy_ids ) ) {
    		echo "<h2>There was an error somewhere and the categories couldn't be set.</h2>";
    	}
    
    	/*	
    	foreach ($meta_values as $key => $value)	{
    		if ($key == "_aviaLayoutBuilderCleanData") { $value[0] = $content; }
    		if ( ! add_post_meta( $page_id, $key, $value[0], true ) ) { 
    		   update_post_meta ( $page_id, $key, $value[0] );
    		}
    	}
    	*/
    }
    
    ?>
    </body>
    </html>
    
    in reply to: Add portfolio by php script #472266

    I got almost everything working perfectly, thx to your code help, except that i have a little bug.

    To make it short, I have a portfolio item that i use like a template to grab all the content and just replace some {{DATA}} in the text content to create my portfolio from my csv list. This part is working fine and at the end i have my portfolio created with tags, categories, content, title, etc.

    When i check this new portfolio right away the visual is a little different then it should be (I have featured image at top, tags just over footer and some issue with css). Then if i just go edit the portfolio, dont change anything but click the update button, if I return check the portfolio, now it show perfectly…

    So digging in a little more made me found that this is related to post meta. I tryed to simply copy the meta from my template portfolio but if i pick all fields i see warning appears, If i dont pick the _avia_builder_shortcode_tree and _aviaLayoutBuilderCleanData I end up with empty portfolio…

    So my question is this one… Is there a function i could call to update the portfolio to force correct meta creation??

    Since you helped me on this job, i’ll post my code when i am done with coding it

    Thanks in advance

    in reply to: Add portfolio by php script #472101

    Just wanna say that your codes helped me figure how to do it, so thanks a bunch

    I was looking for thoses 2 codes :

    <?php wp_get_object_terms( $object_ids, $taxonomies, $args ); ?>
    <?php wp_set_object_terms( $object_id, $terms, $taxonomy, $append ); ?>

    I didnt know how it was called but with you pointing me about “terms”, i found it. Thanks a bunch again for the very fast and helpful response. You can flag the topic with completed and fixed, thanks

    • This reply was modified 9 years, 5 months ago by lepetitweb.
    in reply to: Add portfolio by php script #472095

    Thanks a lot for thoses 2 codes, it’s very helpfull !!!

    The 1st code will help me with search result page i’ll have to create and the 2nd code might help me find the right documentation to get the categories of a specific post

    Thing I would miss is a way to add some categorie to a portfolio using php. To explain more, I can create portfolio page, add feature image, add texts, add tags and even add the wpml translation to that portfolio. The thing i still not get is how the link works beetween a taxonomy (categories) and a post (portfolio)… So how can I get the specific categories of a specific portfolio and how can I set specifics categories for a specific post…

    Something like get_post_term( $id_post) and set_post_term ($id_post, $terms)….. Of course, this is just an exemple to clarify my need but it’s what i need…

    Once again thanks a lot for this amazing support and theme, you guys rock

Viewing 30 posts - 1 through 30 (of 32 total)