Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author isabel104

    (@isabel104)

    Can you please post the code that you are using to add an additional row. The examples from the FAQ page work. I’ve also tested with the Shopfront theme.

    If you are using an example like the 2nd one on the FAQs, be sure to include this line:

    global $post;

    at the beginning of the function. If you post the exact code you tried, I can investigate the problem.

    Thread Starter JamesR1

    (@jamesr1)

    Hi, I’ve added the code below between the two functions that I’ve put the headers for.
    But I whilst I am using a child theme, I’m not using a functions.php in the child theme, just the functions file in the original theme.
    /**
    * Add a custom row with a custom meta field to EDD Software Specs table
    */

    function my_add_specs_table_row() {
    
        global $post;
    
        echo '<tr><td>';
        echo 'License';
        echo '</td><td>';
        echo get_post_meta($post->ID, 'my_license', true);
        echo '</td></tr>';
    }
    
    add_action ( 'eddss_add_specs_table_row', 'my_add_specs_table_row');
    /**
     * General theme setup
    /**
     * Creates a nicely formatted and more specific title element text

    I have successfully added an table option through the alternative method of adding it to the edd-software-specs-php. But I’m obviously doing something wrong overall with the functions file.

    Is the microdata specifically defined by google? Ultimately it’s not necessarily that useful in my case but it would be useful to use dropdown choices and look at some different microdata options.

    regards,
    James

    Thread Starter JamesR1

    (@jamesr1)

    Just to get back to you, I can see the Licence row is now viewable in the spec table, but its not available in the admin area page options where you fill in the rest of the details.

    I have uploaded the functions.php that has been created in the Shop – Front child theme, rather than edit the main functions theme. I had created the child theme with a child theme creator as well.

    Anyway it does now show up on the page but doesn’t show up in the panel to edit.
    Thanks.

    Plugin Author isabel104

    (@isabel104)

    1. Your code should work even in the functions file in the parent theme. The only problem I can think of (without seeing your theme or site) is that there may be a priority conflict.

    So, to try to add the table row later, instead of the code above, you could try this in the parent’s functions file:

    function my_add_specs_table_row() {
    
        global $post;
    
        echo '<tr><td>';
        echo 'License';
        echo '</td><td>';
        echo get_post_meta($post->ID, 'my_license', true);
        echo '</td></tr>';
    }
    
    function later_add_specs_table_row() {
    	add_action ( 'eddss_add_specs_table_row', 'my_add_specs_table_row');
    }
    add_action ( 'init', 'later_add_specs_table_row', 9999);

    2. Yes, the “Software Application Types” were specifically defined by Google. They are the only “supported software application types” for the property of “SoftwareApplicationCategory”.

    (Although “SoftwareApplicationCategory” is not listed as a property on the schema.org page for SoftwareApplication, please see this page and scroll to “softwareApplicationCategory”. You’ll see a link to “supported software application types”.)

    I see now that link to these “supported software types” is broken. It seems that Google may have taken the list down. I originally got the list from them. Although they seem to have taken the list down, I just re-tested the mirodata in Google’s Structured Data Testing Tool, and I find that the same rules apply.

    In other words, if you don’t use one of the listed types, then you will not get a rich snippet. I tried using random text for the “Software Application Type” such as “Money App”, and I got no snippet. Some random text does give a snippet (“Finance” works), but it’s not guaranteed to work. Only the list which I include in the plugin seems to be guaranteed to work to generate a rich snippet. (The exception, as stated in this plugin’s FAQ, is if you select “Other Application”. “Other Application” will not give you a rich snippet.)

    Please note that we are discussing the plugin’s Specs option called “Software Application Type – For Microdata“. This will not be visible to your visitors. The option that is visible to your visitors is, “Software Application Type – For Display“. In this “For Display” option, you can type whatever you like.

    Which microdata options are you seeking? I will keep on eye on Google’s pages to see if they change these rules for Software Application rich snippets.

    I hope this helps.

    Thread Starter JamesR1

    (@jamesr1)

    Well its a 3d games file site so I wanted to know whether I could find more useful microdata. Or actually even remove the option if it was just going to mislead people. Its for Project Anarchy files, which is a little like Unity.
    Design application and game application look like good choices. I guess I don’t have to worry about it really.

    I’ve done what you’ve suggested in the parent functions.php. And the Licence row does show up in the download page, it just doesn’t state ‘mylicence’ nor can I see where to fill it in. I.e. its still not possible to provide details in the ‘edit download’ page as well.
    But thanks for the help.

    Plugin Author isabel104

    (@isabel104)

    Very sorry for the delay.

    Actually, yes, that is all the function does. It adds an extra row, but it doesn’t add the setting to the ‘edit download’ page. It is just a filter for people to use as they wish.

    I will definitely make the few changes which are needed in order to add it as an extra setting in the Specs metabox on the ‘edit download’ page. This will be added to the next plugin update. Thanks for your patience.

    Thread Starter JamesR1

    (@jamesr1)

    Ah, no problem. I didn’t realise.
    Alternatively you could write a guide on adding and changing rows through the main php file. It depends. I think this is a great plugin.

    I’m definitely going to see if I can add another drop down box option myself to file types. But then I want to see if I can have 3 in the same row. So an output could say

    File types: Mp3, jpg, licence.
    Though I guess checkboxes might be good.
    Anyway. Thanks for your help. I’ll mark it has resolved.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Adding a row’ is closed to new replies.