Forum Replies Created
-
AuthorPosts
-
May 19, 2021 at 11:43 PM in reply to: ✅Relationship CPT Title not Displaying using MB View Shortcode #28307
Shrini
ParticipantHere is the video for your reference ....just simple task, I dont know where I am making mistake
May 19, 2021 at 9:02 PM in reply to: ✅Relationship CPT Title not Displaying using MB View Shortcode #28298Shrini
Participantstill not able to display the values
here is the MB View
codeCandidate 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/>May 19, 2021 at 8:57 PM in reply to: ✅Relationship CPT Title not Displaying using MB View Shortcode #28296Shrini
ParticipantOk fixed the syntax error & saved successfully
May 19, 2021 at 8:52 PM in reply to: ✅Relationship CPT Title not Displaying using MB View Shortcode #28294Shrini
ParticipantI 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 fileShrini
ParticipantThank you
Shrini
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 %}Shrini
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>
Shrini
ParticipantMay 15, 2021 at 11:08 PM in reply to: ✅Bug :: Adding prefix to Separate Database Table is not working #28208Shrini
ParticipantZzz
Thank YOU
Shrini
Participantchange premalink to plain
test
now you can change the premalink to postname
works
for every new item creation I am doing this
please fix itShrini
ParticipantOK
Save the permalinks to plain first
check your CPT
if it works
once again change to Post NameThere Ends The Matter
Wasted 4 hours for this simple fix ..... regretting for not buying Toolset
Shrini
ParticipantI have the same issue i.e works only if it is in numeric or plain permalink structure
-
AuthorPosts