Skip Navigation

[Resolved] I want the Related Company Name under every job posts and I want the continuation of the serial numbers

This support ticket is created 5 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 8 replies, has 2 voices.

Last updated by deepS 5 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#1315153

Hi Lou,
Sorry I kept you waiting for a long time. See I have created one view named as 'weekly jobs' comprising the RFG and planted it on the view you created 'Expired Job posts - within 7 days' which is showing up on the page hidden link

Now see I have attached one screenshot for the thing I want to achieve. I want the Related Company Name under every job posts and I want the continuation of the serial numbers (marked in circles) like starting with 1 and counted till it ends. Hope you understand my point.

I can help you if you need any other information.

#1315159

Hello,

I can get your website credentials in previous thread:
https://toolset.com/forums/topic/different-archive-style/#post-1312097

Since you using one-to-many relationship between "Companies" and "Jobs", so you can display parent "Companies" within job post content, for example, edit the post view "Expired Job posts - within 7 days":
hidden link

in section "Loop item in Expired Job posts - within 7 days", line 2, add below codes:

<br />Company: [wpv-post-title item="@company-job.parent"]

Test it in front-end, you should be able to see the company information under each Jobs title:
hidden link

#1315181
Screenshot_3.jpg

See I was expecting this view given on screenshot_3. The view you have shown in the example are not my requirements, rather I want to achieve the view shown in the screenshot. And also suggest me the way how can I re-arrange the serial numbers so that it looks like the continuation.

Hope you understand my point.

#1315191

it is displaying the grand parent post information, I have done below modifications in your website:
1) Create a content template: parent-job-post-information:
hidden link
with below codes:

Company: [wpv-post-title item="@company-job.parent"]

2) Edit the post view:
hidden link
in section "Loop Editor", insert above content template shortcode:

[wpv-post-body view_template="parent-job-post-information" item="@job-post-details.parent"]

Please test again, check if it is what you want, more help:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-fields-of-grandparents/

#1316431

Hi, You are terrific. You solved one of my problems of showing the company name. Now please help me with the serial numbers of the post name. Every time it starts from '1' as the 'Job post' changes. You can see it in the screenshot_3 given earlier.

I want the serial numbers to be continued till the post names exhaust. Hope I can make you understand. Thanks

#1316759

As you can see, there isn't such kind of built-in feature within Views plugin, it needs custom codes, I have done below modifications in your website:
1) In your theme file "functions.php", add below codes:
hidden link

add_shortcode('serial-numbers', function($atts, $content){
	static $num;
	if(!$num){
		$num = 0;
	}
	$num += 1;
	return $num;
});

This will create a custom shortcode [serial-numbers]

2) Edit the post view "Weekly Jobs"
hidden link
in section "Loop Editor", replace the shortcode from:
[wpv-loop-index accumulate="true"]
To:
[serial-numbers]
Please test again, check if it is what you want, thanks

#1316953

Wow, you are simply great. I have achieved everything I needed and you did things so patiently and neatly that I must appreciate.

I have tried adding pagination to the results and added some code (including CSS) in Loop editor of 'Weekly Jobs' view: hidden link
But the paginations are not appearing. Can you help me find out where the wrong is? Thanks.

New threads created by Luo Yang and linked to this one are listed below:

https://toolset.com/forums/topic/the-paginations-are-not-appearing/

#1316959

I assume the original question of this thread is resolved, for other new questions please check the new thread here:
https://toolset.com/forums/topic/the-paginations-are-not-appearing/

#1316965

My issue is resolved now. Thank you!