Forum Replies Created

Viewing 15 replies - 1 through 15 (of 35 total)
  • Thread Starter otta88sun

    (@otta88sun)

    SOLVED. The problem was in sidebar option, i had to set the tag before and after title and widget.

    Thread Starter otta88sun

    (@otta88sun)

    PS: widget class too, is not outputted.

    ex of my output

    the title
    <div class=”textwidget”>
    the text
    </div>

    ex of how should be output

    <div class=”widget”>
    <h4>the title</h4>
    <div class=”textwidget”>
    the text
    </div>
    </div>

    Thread Starter otta88sun

    (@otta88sun)

    i added this before return $content; at the end of the function.

    add_filter( 'wp_mail_content_type', 'set_html_content_type' );

    But have no idea how disable it, because disable it with

    remove_filter( 'wp_mail_content_type', 'set_html_content_type' );

    before end of function will disable html.

    However works without disabling it too.

    Thread Starter otta88sun

    (@otta88sun)

    I did this and work:

    function my_awesome_retrieve_password_message( $content, $key )
    {
            $input = filter_input( INPUT_POST, 'user_login', FILTER_SANITIZE_STRING );
    
            if( is_email( $input ) )
            {
                    $user = get_user_by( 'email', $user_login );
            }
            else
            {
                    $user = get_user_by( 'login', sanitize_user( $input ) );
            }
    
            $content = '<strong>'.get_bloginfo('name').' - Reimpostazione Password</strong><br/><br/>';
            $content .= sprintf( 'Ciao %s, è stata richiesta la reimpostazione della password per il tuo account<br/>', $user->first_name );
            $content .= 'Non cliccare sul link in basso se non hai effettuato la richiesta<br/>';
            $content .= sprintf( '%s?action=rp&key=%s&login=%s', wp_login_url('url'), $key, $input );
    
            return $content;
    }
    add_filter ( 'retrieve_password_message', 'my_awesome_retrieve_password_message', 10, 2 );

    But the email is sent in text, any way to set it in html? Thank you.

    Thread Starter otta88sun

    (@otta88sun)

    Thank you! XD

    i had same problem too passing at ‘cat’ array or integer.
    I solved passing string.
    Them could switch it to an array ;D

    Thread Starter otta88sun

    (@otta88sun)

    Thank you for the attention!

    Thread Starter otta88sun

    (@otta88sun)

    HI, i updated now, but still same problem, can’t see Custom Field in post edit and Next gen gallery icon…

    Thread Starter otta88sun

    (@otta88sun)

    sure, i’ll update you. Thank you for the work ??

    Thread Starter otta88sun

    (@otta88sun)

    Hi! I found the solution! Everything is in this topic: Solution

    However my idea is that the index page has some parameters like posts_per_page that can’t be overwrite, a custom wp_query() can’t do it too.

    With post__in the problem was that i’ve had to order the post for the post__in like ‘orderby’ => ‘post__in’, else it show post from the newest to oldest.

    Thread Starter otta88sun

    (@otta88sun)

    sure i know, I can have only a main loop. But the custom wp_query like $myloopcustom = new WP_Query($argscustom); shouldn’t create problem. That is what I’ve learned until now…. Then there is to see…

    Thread Starter otta88sun

    (@otta88sun)

    hi! nice! it works! But is a “official way” to fix it? Or a custom one?
    However my biggest question is always why in a wp_query custom loop so much difficult things…

    Thread Starter otta88sun

    (@otta88sun)

    Hi, tried but id doesn’t work. This is my first real big problem i faced with WP. In my mind i figure that the main query loop overwrite some parameters of this query. But its strange, i use a custom wp_query…

    Thread Starter otta88sun

    (@otta88sun)

    it doesn’t work, so i post the complete code of loop.php. I remeber the problem i’m asking for: “Some parameters like post__in and post_per_page seems to be overwritten by the main homepage wordpress loop”

    All the code is correct ($near_post has all elements id, the problem is really in the query, but can’t understand what is it)

    <?php
    /*
     * Template - loop.php
     *
     */
    ?>
    <div id="mainloop">
    <?php
    
    $args = array(
    	'post__not_in' => get_option('sticky_posts'),
    	'ignore_sticky_posts'=>1,
    	'category__in' => array(1),
    	'post_type' => 'post'
    );
    
    if ( is_user_logged_in() ): // Utente Loggato?
    	$preferenza_utente = get_user_meta(get_current_user_id(), 'wpcf-priorita', true);
    	$posizione_utente = get_user_meta(get_current_user_id(), 'wpcf-luogo', true);
    	$luogo_lat = get_user_meta(get_current_user_id(), '_luogo_lat', true);
    	$luogo_lng = get_user_meta(get_current_user_id(), '_luogo_lng', true);	// Ottengo Coordinate
    
    	//echo $preferenza_utente.' - '.$posizione_utente.' - '.$luogo_lat.' - '.$luogo_lng;
    
    	if( ($preferenza_utente == 1) && ($posizione_utente != 'ALTRO') && ($luogo_lat != NULL && $luogo_lng != NULL) ): // Utente vuole la priorità e abita in Provincia? Ok, procediamo a cercare gli articoli
    
    		$year = date( 'Y', current_time( 'timestamp', 1 ) );
    		$mont = date( 'n', current_time( 'timestamp', 1 ) );
    		$day = date( 'j', current_time( 'timestamp', 1 ) );
    		$args2 = array(
    			'date_query' => array( // ARTICOLI DI OGGI
    				array(
    					'year'  => $year,
    					'month' => $month,
    					'day'   => 10 //$day
    				)
    			),
    			'post__not_in' => get_option('sticky_posts'),
    			'meta_query' => array(	// CAMPI COORDINATE ESISTENTI
                      array(
                         'key' => '_pronamic_google_maps_latitude',
                         'compare' => 'EXISTS'
                      ),
    				  array(
    					 'key' => '_pronamic_google_maps_longitude',
                         'compare' => 'EXISTS'
    				  )
    			),
    			'category__in' => array(1),
    			'post_type' => 'post'
    		);
    		$my_query2 = new wp_query( $args2 );
    		$near_post = array();
    		while( $my_query2->have_posts() ){
    			$my_query2->the_post();
    			$post_lat = get_post_meta(get_the_ID(),'_pronamic_google_maps_latitude', true);
    			$post_lng = get_post_meta(get_the_ID(),'_pronamic_google_maps_longitude', true);
    
    			$theta = $luogo_lng - $post_lng;
    			$dist = sin(deg2rad($luogo_lat)) * sin(deg2rad($post_lat)) +  cos(deg2rad($luogo_lat)) * cos(deg2rad($post_lat)) * cos(deg2rad($theta));
    			$dist = acos($dist);
    			$dist = rad2deg($dist);
    			$miles = $dist * 60 * 1.1515;
    			$miles *= 1.609344;
    
    			//echo ' - '.get_the_ID().' - '.$miles;
    
    			if($miles <= 20){ // Se il post è vicino ad almeno 20Km
    				$near_post[] = get_the_ID(); // Ottengo lista id
    			}
    		}
    		//foreach($near_post as $posta){ echo ' - '.$posta; }
    		$ppp = get_option('posts_per_page');
    		$count = count($near_post);
    		$less = $ppp - $count;
    		//echo ' - '.$ppp.' - '.$count.' - '.$less;
    		if($count < $ppp){ // Troppo pochi post? Aggiungiamo i mancanti
    			$args2 = array(
    				'post_type' => 'post',
    				'post__not_in' => $near_post,
    				'post_per_page' => $less,
    				'category__in' => array(1)
    			);
    			$my_query2 = new wp_query( $args2 );
    			while( $my_query2->have_posts() ){
    				$my_query2->the_post();
    				$near_post[] = get_the_ID();
    			}
    		}
    		//foreach($near_post as $posta){ echo ' - '.$posta; }
    		$args = array(
    			'post_type' => 'post',
    			'post__in' => $near_post,
    			'category__in' => array(1)
    		);
    
    	endif;
    endif;
    
    query_posts($args);
    $dim = 'medium';
    
    $iloop = 0;
    while (have_posts()) : the_post(); ?>
    	<?php if(has_post_format('status')): ?>
    		<a <?php post_class('loop'); ?> id="post-<?php the_ID(); ?>" href="<?php the_permalink(); ?>" style="<?php echo wepavia_back_type(1); ?>" <?php if($iloop>3){ echo 'title="'.wepavia_mediumbox_title().'"'; }?> >
    			<div>
    				<div class="text"><?php echo get_the_content(); ?></div>
    			</div>
    		</a>
    	<?php elseif(has_post_format('image')): ?>
    		<?php $wpc_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), $dim); //thumbnail ?>
    		<a <?php post_class('loop'); ?> id="post-<?php the_ID(); ?>" href="<?php the_permalink(); ?>" style="<?php echo wepavia_back_type(1); ?>" >
    			<div style="background: url(<?php echo $wpc_image_url[0]; ?>); background-size: cover; background-position: center center; background-repeat: no-repeat;" >
    				<div class="like"><?php echo get_post_meta(get_the_ID(), 'facebook_like_count', true).' like'; ?></div>
    				<div class="text"><?php echo wepavia_preaddcat().get_the_title(); ?></div>
    			</div>
    		</a>
    	<?php else: ?>
    		<?php $wpc_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), $dim); //thumbnail ?>
    		<a <?php post_class('loop'); ?> id="post-<?php the_ID(); ?>" href="<?php the_permalink(); ?>" style="<?php echo wepavia_back_type(1); ?>" <?php if($iloop>=7){ echo 'title="'.wepavia_mediumbox_title().'"'; } ?> >
    			<div style="background: url(<?php echo $wpc_image_url[0]; ?>); background-size: cover; background-position: center center; background-repeat: no-repeat;" >
    				<div class="date"><?php echo get_the_date(); ?><?php echo ' | di '.get_the_author(); ?></div>
    				<h2><?php echo wepavia_preaddcat().get_the_title(); ?> <?php echo wepavia_leggicaso(get_the_ID()); ?></h2>
    				<div class="like"><?php echo get_post_meta(get_the_ID(), 'facebook_like_count', true).' like'; ?></div>
    				<?php echo wepavia_addcontent(); ?>
    				<div class="looptext"><?php echo strip_tags(get_the_content('(continua...)')); ?></div>
    			</div>
    		</a>
    	<?php endif; ?>
    <?php $iloop++; endwhile; ?>
    </div>

    [Moderator Note: No bumping, thank you.]

    Thread Starter otta88sun

    (@otta88sun)

    Means, i think that every loop loaded in the home page have some parameters that can’t be overwritten. Every loop, every kind.

    If i set up a custom wp_query, the problem is the same. Seems that there is a upper “god” query which parameters can’t be rewrite.

    Very strange…. And I’m loosing hairs for this XD

Viewing 15 replies - 1 through 15 (of 35 total)