Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Forum: Fixing WordPress
    In reply to: Add fields to post

    I am trying to implement a copy of the function the_title() lets call it the_secondtitle();

    I added a new database field just near post_title field in wp_posts database table lets call it post_secondtitle

    i want to have a the_secondtitle(); function that behaves exactly as the_title(); function except that it pulls the value from post_secondtitle database field rather than the original post_title field.

    I know all about custom fields but as the custom field databse sits in another table than the wp_posts table i dontwant to use customfields function.

    Can you describe me what to add to my functions.php to have an extra function called the_secondtitle(); that would bring the value that sits in post_secondtitle database field that is in the wp_posts database table?

    Forum: Fixing WordPress
    In reply to: Add fields to post

    oh wait.. i think i made a small mistake. now the site does not crash

    Forum: Fixing WordPress
    In reply to: Add fields to post

    i think we have a syntax error at the function somewhere because when i add that function to functions.php then the site crashes

    Forum: Fixing WordPress
    In reply to: Add fields to post

    i will try it and inform you as soon as possible.

    by the way are you in WP team?

    Forum: Fixing WordPress
    In reply to: Add fields to post

    thank you for your attention and time. but i already know all about WP custom fields. but the problem is that the custom field data are stored in a different database table then wp_posts. i prepare my database manually and i update my database from phpmyadmin (because of the different type of work i do with WP) and the only thing i need is to make some extra functions that would display the extra data fields of my posts. WP’s default custom fields would be useful for me if only it stored its data in the database table wp_posts.

    anyhow, if you know what i should do to mimic the_title function and make my own function just to print the value of the extra data field i added to the database wp_posts please guide me.. thanks again

    Forum: Fixing WordPress
    In reply to: Add fields to post

    alright, thanks for your answer. i have just one more question:

    as you know the_title(); prints the title of that particular post when used in the loop. and that title of the post is stored in the database table wp_posts.

    i have added an extra field in that database table (wp_posts) lets call it the second title and i want to copy the code that makes the function the_title(); work and i want to use that code to make an extra function i.e. the_second_title(); or so.

    i dont want you to write any code for me but i just want to know where exactly that piece of code that makes the_title(); function work. i will copy and modify it and i will have an extra function that prints the value of the extra field i had added to the database table wp_posts. each of the rows of that table has a value for this newly added field.

    so what i want you to do is just give me the location of the code that queries the database and prints the value that is stored in the title field of the database table wp_posts. i am planning to copy it paste it and modify it to work for the new field i that i added to the table…

    Forum: Fixing WordPress
    In reply to: Add fields to post

    thank you very much for the answers.. but you see those guys up at th beginning of this thread claim that they actually get it work that way..

    BTW can i include normal php and sql codes inside my loop, will it just work fine if it is correct or will WP somehow disallow me?

    Forum: Fixing WordPress
    In reply to: Add fields to post

    bump up..

    Forum: Fixing WordPress
    In reply to: Add fields to post

    i also have the same problem here, i added a few fields to wp_posts table and i want to have a function that would return those values for that specific post.. i tried this:

    i included the below code in my functions.php file

    function get_fields() {
    global $wpdb;
    $fielda = dbfield;
    }

    and i included the below code in my single.php file:

    <?php get_fields(); ?>

    but it didnt work as i expected.. any advices?

Viewing 9 replies - 1 through 9 (of 9 total)