Building WP theme with Download Manager support

Viewing 5 posts - 1 through 5 (of 5 total)
#39264

correa
Member

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?

#39271

Shahjada
Keymaster

May you please give me an url example or image mockup how you want to implement it, then I can suggest you clearly 🙂

#39288

correa
Member

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 '';
		}
	}
#39380

correa
Member

Any ideas?

#39657

Shahjada
Keymaster
  1. You need to crate in categories for Catalogs (Catalogo), Manuals (Manuais) and Drivers 
  2. Again create 3 pages for Catalogs (Catalogo), Manuals (Manuais) and Drivers 
  3. Now add category short-code in corresponding pages, like Catalogs category short-code in Catalogs page
  4. Now in your sidebar, use those 3 page urls with your image
  5. Now upload your files and select proper category.
Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Building WP theme with Download Manager support’ is closed to new replies.