- This topic has 4 replies, 2 voices, and was last updated 10 years, 1 month ago by
Shahjada.
Hi,
I have a website that has products like computer boards. They have Manuals, Drivers for Windows, DOS, Linux, etc. What I want is that sidebar.php would display a Manuals button when there are manuals for that product, as well as Drivers button when there are drivers available.
Therefore I need to be able to generate from php code a link to a page that would list Drivers and another one for Manuals. So far I have used a custom property to hold the file ID to feed into wpm_get_package.
That works for some instances of Manuals when I have only one file (there might be more than one kind of Manual per product). But obviously doesn’t work as I expected for drivers. I thought I could somehow get a category ID and display a category instead, but categories seem to only render the text from the file packages it contains, no links to them.
How would you suggest that I implement that?
May you please give me an url example or image mockup how you want to implement it, then I can suggest you clearly š
Sure, this page is currently implemented in something else, I’m trying to reproduce it in WP:
http://www.comm5.com.br/novo/produtos-categoria/placas-seriais-pci-express-33/2sg-pci-e-153
On the right there is a sidebar with 3 link images, one for Catalogs (Catalogo), Manuals (Manuais) and Drivers. Each can either be a single download file (pdf or zip) or have “suboptions” such as “Windows”, “Linux”, etc. So, clicking one of them I would like to get something similar (or better) that this:
http://www.comm5.com.br/novo/departamentos/drivers/153
My current implementation of sidebar.php for WP contains this to get the link:
function comm5_get_download_link($property) {
// Query custom property value
$propertyValue = get_post_custom_values($property);
$wpdm_package = wpdm_get_package(intval($propertyValue[0]));
if ( count($wpdm_package) > 0 ) {
return esc_url( $wpdm_package['page_url'] );
} else if ( count($propertyValue) > 0 ) {
return esc_url( get_permalink( get_page_by_path( $propertyValue[0] ) ) );
} else {
return '';
}
}
- You need to crate in categories forĀ Catalogs (Catalogo), Manuals (Manuais) and DriversĀ
- Again create 3Ā pagesĀ forĀ Catalogs (Catalogo), Manuals (Manuais) and DriversĀ
- Now add category short-code in corresponding pages, like Catalogs category short-code in Catalogs page
- Now in your sidebar, use those 3 page urls with your image
- Now upload your files and select proper category.
The topic "Building WP theme with Download Manager support" is closed to new replies.