Custom Code – related listings
-
Hi,
I am not a developer and was wondering if you would be able to assist me with some code for the following?
I have a network of directory & classified sites. Users have listings under each site. One site is a site for “Hotels” the user also has a restaurant listed under the “Restaurant” site and a nightclub under the “Events” classified site.
When viewing their listing, in the side bar is a widget bringing in their other listings by the same author. I can only manage to bring in their other listings from the same site. I would like to bring in a snippet of their other listings from the other sites – right across the network – not just the hotel site.
I think your plugin seems to be able to do this, but I just don’t know what to write in the widget text area to enable this.
I would be very grateful for some assistance on what to input.
If you need any screenshots, or other info please just ask.
-
Sorry for the very delayed response.
If you’re going to put it in a widget make sure the widget can handle shortcodes. One example is as follows:
[netsposts include_blog=”1,2,5″ include_post=”5″ post_type=”page”]
What the above means:
include_blog= means it will only include blogs with the given id numbers. include_post= means whatever the page or post id is across your network will be added here. So if your friends hotel site was on blog 3 and the page you wanted to show has id number 259 it would look something like this:[netsposts include_blod=”3″ include_post=”259″ post_type=”page”]
If your friends site is a post and not a page change post_type to post_type=”post” or remove it altogether since the default setting is posts.
The readme file has a lot of information on how to set this up. Just activate the plugin on the blogs you want to use the plugin.
Note: you never use include_page just include_post. You set up what type you are going to use via the post_type= argument.
The text that will display by default uses the custom excerpt field on posts and pages which I recommend so you can show exactly what you want. There is an auto excerpt option however. Plus the thumbnail of the image will be the featured image of the post or page. You may turn this off however and not show images. Make sure you read the readme.txt file for all information.
Closing thread.
The topic ‘Custom Code – related listings’ is closed to new replies.