• Resolved savvaskef1978

    (@savvaskef1978)


    hi,
    i wanted to ask is there a procedure
    to add the functionality the documentation
    displays (say for different display lay-outs)
    to codesnippets area (provided by the very
    same plugin)

    i’d like not to change the template’s php in
    anyway..so,

    could you elaborate more on where to add code
    and how to call it so that i can start with
    the example and gradually customize it?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    CSS code (marked with a green alert box) can be placed in Appearance > Customize > Additional CSS.

    PHP code (marked with a blue alert box) can be placed in Snippets > Add New (screenshot) when the Code Snippets plugin is active.

    Thread Starter savvaskef1978

    (@savvaskef1978)

    thnx a lot.can you use code snippets to : posts that match your theme(as in yur tutorials).is that possible?
    if so, can you explain each step of the tutorial (as in how to add a .php page and how to use it?what is a partial? how(and when) does the code interact with word-press and/or theme?what changes when you use codesnipeets?
    (also a bit of documentation would be useful – especially if it takes any burden from you by my questions)

    Plugin Author Bill Erickson

    (@billerickson)

    Here’s a tutorial on using template partials in Display Posts: https://displayposts.com/2019/01/04/use-template-parts-to-match-your-themes-styling/

    The actual code you use will depend heavily on your theme, so I can’t provide any more specific instructions.

    If you need help customizing your theme, I recommend hiring a developer on Codeable

    Thread Starter savvaskef1978

    (@savvaskef1978)

    In the beginning, after I copied the partials folder(https://github.com/billerickson/EA-Starter/tree/master/partials) in both wp-includes and wp-content and added dps-large.php and dps-small.php, I also added the code found in Specify a layout in the shortcode
    Article in code-snippets (and enabled it)

    I used [display-posts] short-code as found in the following slides I got an error starting with :

    Fatal error: Uncaught Error: Call to undefined function ea_entry_image_id() in …

    Later on a second wordpress installation I did the same and there was a result but no difference…I used
    [display-posts layout=”large” image_size=”thumbnail” post_type=”job_listing” include_excerpt=”true” excerpt_length=”20″ meta_key=”_thumbnail_id” posts_per_page=”3″ wrapper=”div” wrapper_class=”display-posts-listing grid”]
    …changing “small” with “large”

    [display-posts layout=”large”] and [display-posts layout=”small”] had noe effect either (it just brought no images)

    can you figure what’s missing?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘is there a way to add code to codesnippets?’ is closed to new replies.