• I first had the following error
    Warning: Invalid argument supplied for foreach() in /homepages/23/d187487723/htdocs/xxxxxxx/wp-content/plugins/custom-post-view-generator/index.php on line 467

    I deleted two list views I had created and now I get the following error in the post
    No list view with the name ‘list1340824920796’ was found.

    What I want, in fact, I believe, is post views. I created several fields in two groups, Ideas and Minuta, with ACF.

    When a user posts a new post and selects a category, he/she automatically gets the corresponding ACF template. The categories are also called Ideas and Minuta (plus other categories that I don’t want a special template for).

    I don’t see where I can add different post views but rather only one so I added in the fields from ACV in one post view and just indicated that they should be hidden if empty. So, if someone posts a post using the Ideas category and template from ACF, then logically anything posted in the Minuta custom fields wouldn’t appear, or rather, there wouldn’t have been anything entered as that template did not appear to the user.

    On the front end, I need the Ideas category’s posts to show the fields and data from the Ideas template (not referring to a WP post template but rather the template ACF renders when writing a post), then I need the data and field names to display on the front end.

    I don’t see where the more tag can fit in here at all which bothers me.

    Also, in list view, under the CPVG menu items, there are no fields to drag there. I only see draggable fields on the post view option. I think that’s OK because I don’t want a list view.

    Please let me know if the above logic will work with this plugin and what I am doing wrong in order to generate the above errors and how to fix them so that the custom fields data can render on the display side after writing the post with the ACF templates.

    http://wordpress.org/extend/plugins/custom-post-view-generator/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Marco Constancio

    (@marco-constancio)

    Greetings,

    I first had the following error
    Warning: Invalid argument supplied for foreach() in /homepages/23/d187487723/htdocs/xxxxxxx/wp-content/plugins/custom-post-view-generator/index.php on line 467

    I believe you get this warning when try to see a list without any associated fields. Try to add fields.

    I deleted two list views I had created and now I get the following error in the post
    No list view with the name ‘list1340824920796’ was found.

    Post views requires not additional work, but for list views to be displayed correctly, you need to create a post with shortcode like this [cpvg_list name=’list1340903551913′]. You problably created a post with ‘Create post for this list’ button but when you deleted the list you forgot to update the post to match the new list name or you didn’t create a new post for the lists that you created.

    Also, in list view, under the CPVG menu items, there are no fields to drag there. I only see draggable fields on the post view option. I think that’s OK because I don’t want a list view.

    The acf plugin stores the fields in the postmeta field section. Check for that section. Add a few records that use field that you added before testing.

    As for the your problem: the acf plugin bahaves dirently from other plugins, it created custom fields and associates them to a normal wordpress posts. Because of this, this plugin is very limited and you have to apply the logic that you described and it that reason that you can’t create diferent post view since my plugin can only make a post view for each post type (including wordpress normal posts and pages), unless you make a wordpress/acf template that works around that problem.

    For your sitution I would recomend that you try another plugin on my recomend list because with other plugin with other plugins you can create your own post type and associated the fields that you want.

    The acf plugin support in my plugin was added by request but I haven’t had the time to understand the more advanced stuff like the functions that provides, so I might not be a great help.

    Please test all the things that I wrote and tell me if any error emerge and I try to correct as best I can.

    Thread Starter ecn

    (@ecn)

    Thank you. Can you possible recommend one that will work on the front end with ACF on the back end? As for list views, I don’t wish to use it altogether and did not create any post for it. I want all posts that use the ACF templates to render the post views with the custom fields on the front end. Will this work with the two plugins and the above logic, hiding empty fields?

    I cannot ask my contributers that will upload ideas and minutes periodically to add shortcodes. I need to automate this for them.

    Plugin Author Marco Constancio

    (@marco-constancio)

    From your answer, it appears your misinterpreting the purpose of my plugin so I going assume that and try explain the best possible, the entire situation.

    When viewing a post in the frontend, my plugin essatially, replaces the content of a post with the content of other fields that were selected in the backend and that is the Post Views function of my plugin.

    During the act of replacing the post content, it adds html and css that is taken from the folder wp-content/plugins/custom-post-view-generator/templates/post/ to style the presentation of data and it possible to make more complex things since the templates for my plugin are in php. Thanks to this, a user doesn’t have to make any modification to the wordpress templates or code anything, unless he/she wants to change the presentation of the displayed data.

    The List Views, allows to display data of fields from several posts and shows that data in a post thanks to a shortcode. I’m not sure what you want to do, but I believe you don’t need to change shortcodes each time there is update, you can make a list view that displays fields from all posts from a certain category/user/etc and all current posts that match conditions that you specified will displayed even if modifications were made.

    However, the main point that I want to transmit it that my plugin is only meant to display the data from fields created by other plugins. The plugins that I tested are specified in http://wordpress.org/extend/plugins/custom-post-view-generator/.

    But if you going to create a ACF template, modify a wordpress template or make any kind of code to diplay fields, then there is no point in using my plugin.

    Having wrote all that, I sugest you do one of 3 things:

    1 – Use the acf to create the fields that you want and add acf functions to your wordpress template like the_field, etc and using if statements to display the data differently, depending of fields are being used. Note: I assume this the acf templates that you mention.

    2 – Use the acf to create the fields that you want and create a Post View with my plugin, cheking hiding empty fields option and modify or create a template for my plugin for better refinetment. If you do this start by checking the existing template and the file template_manual in that directory.

    3 – Use one of the other plugins that I recomended in http://wordpress.org/extend/plugins/custom-post-view-generator/, create diferent post types, like Ideas and Minuta (with their respective fields) and use my plugin to create a view for each post type.

    It is possible that I also misinterpreting what you want to do, so after reading this answer, write again.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Custom Post View Generator] Errors on activation’ is closed to new replies.