Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: while() and newline (\n), how does it make sense?

Discussion in 'Misc WordPress Requests' started by TheDani, Mar 25, 2018.

  1. TheDani

    Guest

    Reply To: while() and newline (\n), how does it make sense?, by TheDani

    No. This has two records: activity and post.activities_label (and post.activities)


    'post_type' = 'activity', //activity
    'posts_per_page' = '-1',
    'meta_key' = 'activities_label', //post.activities_label
    'compare' = 'EXISTS'


    Edit Pod – Manage Fields (Pods Admin):
    * post – activities (relationship – activity) and activities_label (plain paragraph text).
    * activity – facilities (relationship – simple custom defined list)

    WordPress, Pods Admin, Manage Pods, Post

    Activities
    Label: Activities
    Name: activities
    Field Type: Relationship
    Relates: Activities

    Activities Label
    Label: Activities Label
    Name: activities_label
    Field Type: Plain Paragraph Text
    Output options: empty

    WordPress, Pods Admin, Manage Pods, Activity

    Facilities
    Label: facilities
    Name: facilities
    Field Type: Simple Custom defined list
    Custom Defined Options: a, b, c, d, e, f, g, etc

    But later, facilities.


    $args = array(
    'post_type' => 'activity',
    'posts_per_page'=>'-1',
    'meta_key' => 'activities_label',
    'compare' => 'EXISTS'
    );
    $query = new WP_Query($args);
    while($query->have_posts()) :
    $query->the_post();
    $activities_label = get_post_meta(get_the_id(), 'activities_label', true);
    echo "<br>".get_the_title()."<br>".$activities_label."<br><br>";
    endwhile;

    View:
    ,

    Reply To: while() and newline (\n), how does it make sense?
     
    #1

Share This Page

Monarch Social Sharing Plugin