Support Forum » User Profile

Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • ShriniShrini
    Participant

    Here is the video for your reference ....just simple task, I dont know where I am making mistake

    https://www.loom.com/share/09beaf22c6e64e4b8d7b817cc6d0e2c0

    ShriniShrini
    Participant

    still not able to display the values

    here is the MB View
    code

    
    Candidate List:
    
    {% set relationship = attribute( relationships, 'candidate_party' ) %}
    {% for post in relationship.to %}
        {{ post.title }}
    {% endfor %}
    
    <br/>
    <br/>
    
    {% set relationship = attribute( relationships, 'candidate_party' ) %}
    {% for post in relationship.from %}
        {{ post.title }}
    {% endfor %}
    {% for post in relationships.candidate_party.to %}
        {{ post.title }}
    {% endfor %}
    {% for post in relationships.candidate_party.from %}
        {{ post.title }}
    {% endfor %}
    <br/>
    <br/>
    
    ShriniShrini
    Participant

    Ok fixed the syntax error & saved successfully

    ShriniShrini
    Participant

    I pasted the generated code from relationship in theme main function file through theme editor in wordpress but it shows

    Your PHP code changes were rolled back due to an error on line 69 of file wp-content/themes/Extra/functions.php. Please fix and try saving again.

    syntax error, unexpected '<', expecting end of file

    
    /*** Meta Box Functions by Shrini  ***/
    
    <?php
    add_action( 'mb_relationships_init', 'candidate_party' );
    
    function candidate_party() {
        MB_Relationships_API::register( [
            'id'   => 'candidate_party',
            'from' => [
                'object_type'   => 'post',
                'post_type'     => 'candidate',
                'empty_message' => 'No Party Added',
                'admin_column'  => [
                    'position' => 'after title',
                    'link'     => 'view',
                ],
                'meta_box'      => [
                    'title' => 'Party',
                ],
                'field'         => [
                    'add_button' => 'Add Member',
                ],
            ],
            'to'   => [
                'object_type'   => 'post',
                'post_type'     => 'party',
                'empty_message' => 'No Candidates Added',
                'meta_box'      => [
                    'title'   => 'Party Members',
                    'context' => 'normal',
                ],
                'field'         => [
                    'max_clone' => '1',
                ],
            ],
        ] );
    }
    

    so I removed the <?php and pasted but it shows

    
    Your PHP code changes were rolled back due to an error on line 101 of file wp-content/themes/Extra/functions.php. Please fix and try saving again.
    
    syntax error, unexpected end of file
    
    in reply to: CPT url not working in MB View #28220
    ShriniShrini
    Participant

    Thank you

    in reply to: CPT url not working in MB View #28214
    ShriniShrini
    Participant
    {% set candi = {post_type: 'candidate', posts_per_page: 5} %}
    {% set candidates = mb.get_posts( candi ) %}
    
    {% for candidate in candidates %} <br/>
    1. Candidate Name: {{ candidate.post_title }} <br/>
    2. Candidate Link: {{ post.url }} <br/> // displays only current post url
    3. Candidate Link: {{ candidate.url}} <br/>
    {% endfor %}
    in reply to: CPT url not working in MB View #28213
    ShriniShrini
    Participant

    <div>

    {% set candi = {post_type: 'candidate', posts_per_page: 5} %}
    {% set candidates = mb.get_posts( candi ) %}

    {% for candidate in candidates %} <br/>
    1. Candidate Name: {{ candidate.post_title }} <br/>
    2. Candidate Link: {{ post.url }} <br/> // displays only current post url
    3. Candidate Link: {{ candidate.url}} <br/>
    {% endfor %}

    </div>

    in reply to: CPT url not working in MB View #28212
    ShriniShrini
    Participant


    {% set candi = {post_type: 'candidate', posts_per_page: 5} %}
    {% set candidates = mb.get_posts( candi ) %}

    {% for candidate in candidates %} <br/>
    1. Candidate url: {{ post.url }} <br/>
    2. {{ candidate.url}} <br/>
    3. {{ candidate.post_title }} <br/>
    {% endfor %}

    ShriniShrini
    Participant

    Zzz

    Thank YOU

    in reply to: Permalink issue with Custom Post Type #28157
    ShriniShrini
    Participant

    change premalink to plain
    test
    now you can change the premalink to postname
    works
    for every new item creation I am doing this
    please fix it

    in reply to: CPT "Page Not Found" #27993
    ShriniShrini
    Participant

    OK
    Save the permalinks to plain first
    check your CPT
    if it works
    once again change to Post Name

    There Ends The Matter

    Wasted 4 hours for this simple fix ..... regretting for not buying Toolset

    in reply to: CPT "Page Not Found" #27992
    ShriniShrini
    Participant

    I have the same issue i.e works only if it is in numeric or plain permalink structure

Viewing 12 posts - 1 through 12 (of 12 total)