Old
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Help in creating a loop for post_id and meta_value tablesI can see the test text.
I’m sure that there are records on post_id 2171. Just to be sure, the get_post_custom( ), will fetches meta_key and meta_value’s data from that given post_id, right?
Forum: Fixing WordPress
In reply to: Help in creating a loop for post_id and meta_value tablesThanks, but it still returning nothing.
Forum: Fixing WordPress
In reply to: Help in creating a loop for post_id and meta_value tablesThanks for your help.
I created the follow shortcode and put it on functions.php, but it doesn’t return anything.
//Applications list short-code function jb_applicant() { global $wpdb; $custom_fields = get_post_custom(2171); //2171 is the post_id that I'm trying to gather the data from $my_custom_field = $custom_fields['my_custom_field']; foreach ( $my_custom_field as $key => $value ) echo $key . " => " . $value . "<br />"; } add_shortcode('applicant', 'jb_applicant');
Any idea what could be?
Thanks
Hi Josh,
I got it now ??
<?php $my_data = $wpdb->get_var( $wpdb->prepare( " SELECT (meta_value) FROM $wpdb->postmeta WHERE meta_key = 'data7' " ) ); echo "<p>My data is $my_data</p>"; ?>
My next step is to put this in a loop. I want to create a matrix 5×5. Anyway, thank you very much.
Cheers,
Double checked. I have all the entries.
It’s like this:
database ‘wordpress’ ->
table ‘wp_postmate’ ->
column ‘meta_key’ with value ‘data9’
column ‘meta_value’ with value ‘Brazil’So, the info that I want to get is on ‘meta_value’ column.
I tried above. No error, but the variable still empty.
Sorry, my typo. It’s dataN
Fair enough your question.
I’m using Job Manager plugin, which store all the candidate info on wp_postmeta on meta_keys called data2, date3, date4, data5, data6 and data7. What I want to do, is to be able to extract those info from the database and show them like a list of candidates on any regular page.
I’m put this code on my page.php
<?php $meta_key = 'data7'; $my_data = $wpdb->get_var( $wpdb->prepare( " SELECT (meta_key) FROM $wpdb->wp_postmeta WHERE meta_key = 'data7' ", $meta_key ) ); echo <p>My data is {$my_data}</p>; ?>
If I take the brackets out, I get HTTP Error 500.
Okay, no error now. But the echo is not printing anything. It seems to be empty.
Thanks for your help.
“data7” is my meta_key that I want to access and get the data from it. I tried with below.
$meta_key = 'data7'; $my_data = $wpdb->get_var( $wpdb->prepare( " SELECT (meta_key) FROM $wpdb->postmeta WHERE meta_key = 'data7' ", $meta_key ) ); echo "<p>My data is {$my_data}</p>";
Thanks Josh,
I tried your template, but no lucky so far.
Forum: Plugins
In reply to: [Job Manager] Job Manager – Display applicants listI asked the same thing.. last year. No answer so far.
I hope the author can create this feature.
Hi,
Yes, i’m using 3.2.1 and I got the theme here https://www.wpanniversarytheme.com/
Actually, I’m not using this theme, I just wanted you to know about it. But I believe it’s a theme problem, since even the WP admin bar doesn’t work on it. Anyway, thanks for your support.