Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter TataVostru

    (@tatavostru)

    no suport regarding this?

    if you are using custom fields for your storage of person and films you should be able to create a custom query like:

    //The Query
    $the_query = new WP_Query( array( 'meta_key' => 'persoane', 'meta_value' => 'Bruce Willis' ) );
    // The Loop
    while ( $the_query->have_posts() ) : $the_query->the_post();
    	echo '<li>';
    	the_title();
    	echo '</li>';
    endwhile;
    
    // Reset Post Data
    wp_reset_postdata();

    for more information have a look HERE.

    Thread Starter TataVostru

    (@tatavostru)

    yes but i have more actors… i do not want to make another template for another page…

    Thread Starter TataVostru

    (@tatavostru)

    For movies – I am using POST – The movies are post there..
    For actors – I am using post_type : persoane , Taxonomy : lista.

    Ex: In post i add the movie, with title….etc..i’m usig custom field
    Picture: https://cinema.trancelevel.com/1.jpg

    For displayng the actors,regizor… i’m using relationship.
    When i introduce the actor in relationship field, i want automate to get the movie in Actor page…

    Ex: https://cinema.trancelevel.com/persoane/bruce-willis/

    Now the big problem is how can i get the movies in actor page.

    if you are using it as part of the page as you mentioned you are getting the actors name in the first loop.. so do something like:

    //get the actors name from page loop
    $the_actor = get_post_meta($post->ID, 'persoane', true);
    //create new loop query for films by this actor
    $the_query = new WP_Query( array( 'meta_key' => 'persoane', 'meta_value' => $the_actor ) );
    ...
    Thread Starter TataVostru

    (@tatavostru)

    if i add this code…

    <?php foreach(get_field('filme_actor') as $relationship): ?>.....

    i can link, but i want to do automatic… is to much work to do like this.. in movie and actors…link… if you understand…

    Thread Starter TataVostru

    (@tatavostru)

    haxxton can you connect with teamview to my PC and show me…?

    Thread Starter TataVostru

    (@tatavostru)

    i put this code but i don’t retrive nothing…

    <?php
    //get the actors name from page loop
    $the_actor = get_post_meta($post->ID, 'persoane', true);
    //create new loop query for films by this actor
    $the_query = new WP_Query( array( 'meta_key' => 'persoane', 'meta_value' => $the_actor ) );
    
    // The Loop
    while ( $the_query->have_posts() ) : $the_query->the_post();
    	echo '<li>';
    	the_title();
    	echo '</li>';
    endwhile;
    
    // Reset Post Data
    wp_reset_postdata();
    ?>

    im afraid its really hard to understand what you’re showing me in the pictures as i cant read anything other than english very well.

    the above code should make the films visible during run time on the page..

    you may need to adjust some of the names of the meta keys/values to align better with your database structure.. the code was to give you the idea.

    Thread Starter TataVostru

    (@tatavostru)

    can you connect with TeamView to my pc… to show you better..?

    Thread Starter TataVostru

    (@tatavostru)

    i do not thing to get the movies …it shoud use ‘persoane’…because the movies are POSTS

    Thread Starter TataVostru

    (@tatavostru)

    do you have a Yahoo ID?

    when you are creating the movie’s POST, you manually add each actor to that post yes?

    TeamView meeting id: [ redacted ]

    Thread Starter TataVostru

    (@tatavostru)

    For several days we all tried to solve this problem on this forum and Mr. haxxxton solved the problem quickly. A true professional. Thanks again.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Cinema site, retrive the movies that actor play in’ is closed to new replies.