Tagged: ,

Viewing 2 reply threads
  • Author
    Posts
    • #2210
      tuckerjoenz
      Member

      I have a client that is using Yoast and asked my about a custom post type that I created. He said

      “I installed Yoast and it has these optimization suggestions that work on post body. Stories isn’t using that, though, I don’t think. Can it be changed to use the default editor and field for post body?”

      Is there something I need to do different for this CPT or will this work?

      stories.php

      <?php
      /*
      Title: Stories of Impact
      Post Type: stories
      Order: 14
      Meta Box: false
      Collapse: false
      */
      ?>
      
      <?php
      
        piklist('field', array(
          'type' => 'file'
          ,'field' => 'story_media'
          ,'scope' => 'post_meta'
          ,'label' => __('Media Uploader','story-media')
          ,'description' => __('Validation rule set: Upload no more than two files.','story-media')
          ,'options' => array(
            'modal_title' => __('Add File(s)','story-media')
            ,'button' => __('Add','story-media')
          )
        ));
      
        piklist('field', array(
          'type' => 'editor'
          ,'field' => 'story_content'
          ,'label' => 'Add Story'
          ,'description' => 'Stories of Impact'
          ,'options' => array (
            'media_buttons' => true
            ,'teeny' => true
            ,'textarea_rows' => 5
            ,'drag_drop_upload' => true
          )
        ));
      
      piklist('field', array(
           'type' => 'datepicker'
           ,'field' => 'story_date'
           ,'label' => 'Story Date'
           ,'description' => 'Click in box'
           ,'attributes' => array(
             'class' => 'text'
           )
          ,'options' => array(
             'dateFormat' => 'M d, yy'
             ,'firstDay' => '0'
          )
        ));
    • #2211
      tuckerjoenz
      Member

      UPDATE: For stories (and all probably): when we try to override the publish date in quick edit, it erases Yoast SEO information (title, meta description)

    • #2212
      Kevin
      Keymaster

      @tuckerjoenz

      Of course 🙂 You will have to move your content from the post meta field to the post_content for anything already created, however for the field you just need to specify the scope and change the field name like so…

      
      piklist('field', array(
        'type' => 'editor'
        ,'scope' => 'post'
        ,'field' => 'post_content'
        ,'label' => 'Add Story'
        ,'description' => 'Stories of Impact'
        ,'options' => array (
          'media_buttons' => true
          ,'teeny' => true
          ,'textarea_rows' => 5
          ,'drag_drop_upload' => true
        )
      ));
      
Viewing 2 reply threads
  • The topic ‘Using Yoast with Piklist’ is closed to new replies.