Forum Replies Created

Viewing 15 replies - 1 through 15 (of 132 total)
  • Please, the solution that @gersnl posted doesn’t FIX the problem, it HIDES the problem.

    All that it does is tell the site not to warn you about errors.

    If you want a solution and the Devs aren’t helping, find someone who actually knows how to program to help.

    I currently have this issue, with other Devs just hiding it on a Production site.
    Luckily I know what I’m doing and aiming to fix this problem.

    Thread Starter Quin

    (@quin452)

    Hi @hchouhan
    I don’t have access to that information.

    I downloaded from the wordpress plugin page, but also had a backup copy of 4.4.2.

    I do not know where the dynamic link is generated (and cannot get it).

    Also, on maybe a related note, for some reason the download’s aren’t being counted (and according to old logs, they haven’t been for a while).

    Thread Starter Quin

    (@quin452)

    Could you be of any more help, because I’m pretty certain that I’ve got all the correct details following the instructions.

    I’ve just seen this error myself whilst working in a local environment. Is it only when debugging is enabled? (I same files for the dev site).

    There is talk about using an anonymous function to fix (yet to try as I don’t want to mess about with the plugin).

    Thread Starter Quin

    (@quin452)

    UPDATE: I have it fixed. The solution is here.

    Thread Starter Quin

    (@quin452)

    I’ve got it sorted.

    I needed to store $post somewhere as a backup.
    So for the show metabox function, it now looks like:

    		/*	Show roles metabox	*/
    		function show_roles_metabox() {
    			global $post;
    			$tempPost = $post;
    
    			wp_nonce_field(basename(__FILE__), 'role_nonce');
    
    			$pro_areas = array(
    				'One',
    				'Two',
    				'Three'
    			);
    
    		$args = array(
    			'post_type' => 'proarea',
    			'publish_status' => 'publish',
    			'posts_per_page' => -1,
    			'order' => 'ASC'
    		);
    		$the_query = new WP_Query($args);
    		if($the_query->have_posts()) {
    			echo '<ul>';
    			while ( $the_query->have_posts()) {
    				$the_query->the_post();
    				echo '<li>' . get_the_title() . '</li>';
    			}
    			echo '</ul>';
    		} else {
    		}
    		wp_reset_postdata();
    
    		/*
    		$mcpt_query = array();
    		$the_query = get_posts('post_type=proarea');
    		foreach ( $the_query as $post ) : setup_postdata( $post );
    		$mcpt_query[] = array(
    			'title'	=> get_the_title($post->ID)
    		);
    		endforeach;
    		wp_reset_query();
    		print_r($mcpt_query);
    		*/
    
    		$post = $tempPost;
    
    			echo '<span><label for="pro_area">Professional Area: </label></span>';
    			echo '<select name="pro_area">';
    
    			foreach($pro_areas as $pro_area) {
    				if($pro_area == get_post_meta($post->ID, 'pro_area', true))
    					echo '<option selected>'. $pro_area .'</option>';
    				else
    					echo '<option>'. $pro_area .'</option>';
    			}
    
    			echo '</select>';
    		}

    I called global $post, make a backup in $tempPost, and then after the “reset”, I load $psot with $tempPost.

    I need something similar, but I’m not using gravity forms.

    I have a custom post type, and when editing, the author can select an option from a dropdown which is populated by the post titles of another CPT.

    I can get it to populate with wp_query, but as soon as I use that, the values do not save in the metabox and the permalink is changed to that of the last other CPT.

    Any ideas?

    Thread Starter Quin

    (@quin452)

    Thanks.

    This is what I am aiming for.

    	$pro_area_array = array();
    	$pro_area_args = array(
    		'post_type' => 'proarea',
    		'publish_status' => 'publish',
    		'posts_per_page' => -1,
    		'order' => 'ASC'
    	);
    	$pro_area_query = new WP_Query($pro_area_args);
    	if($pro_area_query->have_posts()) {
    		$i = 0;
    		while($pro_area_query->have_posts()) {
    			$pro_area_query->the_post();
    			$pro_area_array += array($i => get_the_title());
    			$i++;
    		}
    	}
    	wp_reset_query();
    
    	$pro_areas = array();
    	foreach ($pro_area_array as $key => $value) {
    		$pro_areas[] = $value;
    	}
    /*
    	$pro_areas = array(
    		'One',
    		'Two',
    		'Three'
    	);
    */
    	echo '<span><label for="pro-area">Professional Area: </label></span>';
    	echo '<select name="pro-area">';
    
    	foreach($pro_areas as $pro_area) {
    		if($pro_area == get_post_meta($post->ID, 'pro-area', true))
    			echo '<option selected>'. $pro_area .'</option>';
    		else
    			echo '<option>'. $pro_area .'</option>';
    	}
    
    	echo '</select>';
    }

    Now the dropdown is populated correctly, and using a “simple” array does as you expect, but whenever I try and use the actual array, the permalink is changed to the last pro-area.

    EDIT: As soon as I try to pul in the pro-area posts, it screws things over, changing the permalink and not saving/selecting the option.

    • This reply was modified 8 years, 1 month ago by Quin.

    Hi @nickat, I’ve seen your post on the job forum however, your email seems to be invalid.

    Thread Starter Quin

    (@quin452)

    Update: I’ve figure it out, or at least I think I have (about to test).
    In the jQuery, I was calling the url for media.attachment. Changing that to ID pulls in the ID for the attachment.
    Now I have a unique identifier to get the meta data ??

    It’s odd how the answer sometimes just pops into your head ??

    Thread Starter Quin

    (@quin452)

    UPDATE: I’ve switched out the code using while (have_posts()) : the_post(); and a query filtering for post_type. Works fine now.

    Still cannot get the Screen Options to work.

    Thread Starter Quin

    (@quin452)

    Yea, I meant that it wasn’t in the Screen Options. It is not below the visual editor, and there is not an option to enable them.

    It is there for regular pages/posts.

    Also, I’m using the following for getting posts:

    <?php
    	global $post;
    	$latestposts = get_posts('numberposts=1');
    	foreach($latestposts as $post) :
    ?>
    <article class="col span_1_of_2">
    	<h2><?php the_title(); ?></h2>
    	<?php the_post_thumbnail('full'); ?>
    	<?php the_excerpt(); ?>
    
    	<aside>
    		<a href="<?php echo esc_url(get_permalink()); ?>" class="slim">Read More</a>
    	</aside>
    </article>
    <?php endforeach; ?>

    How could I modify that for Projects?

    Thread Starter Quin

    (@quin452)

    Hi Jeremy, I’ve added it to my functions.php, and the fields aren’t added.
    (I’m using a custom child theme, so I can edit the functions page without worry of updates)

    Also, how would I get the_title, etc., from a Portfolio Project?

    Thread Starter Quin

    (@quin452)

    I plan on listing the title, the content/excerpt and three images associated with the latest Project.

    So

    Title
    Content | Image 1 | Image 2 | Image 3

    If the function you’ve provided works, it will all that I need ?? I cannot test it ATM.

    Thread Starter Quin

    (@quin452)

    Is there a time-frame?

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