-
AuthorPosts
-
November 30, 2023 at 4:39 pm #1426823
Hello, I’m sending a snippet from the loop-search file
if( 'blog-meta-date' == avia_get_option( 'blog-meta-date' ) ) { $meta_time = '<time class="date-container minor-meta updated" ' . avia_markup_helper( array( 'context' => 'entry_time', 'echo' => false ) ) . '>'; $meta_time .= get_the_time( get_option( 'date_format' ) ); $meta_time .= '</time>'; $meta_info['date'] = $meta_time; } if( get_post_type() !== 'page' && 'blog-meta-comments' == avia_get_option( 'blog-meta-comments' ) ) { if( get_comments_number() != '0' || comments_open() ) { $meta_comment = '<span class="comment-container minor-meta">'; ob_start(); comments_popup_link( "0 " . __( 'Comments', 'avia_framework' ), "1 " . __( 'Comment' , 'avia_framework' ), "% " . __( 'Comments', 'avia_framework' ), 'comments-link', __( 'Comments Disabled', 'avia_framework' ) ); $meta_comment .= ob_get_clean(); $meta_comment .= '</span>'; $meta_info['comment'] = $meta_comment; } }
Now the structure is Date, separator, comments.
I’m not sure how to change the structure to Category, Date, Author
I would greatly appreciate your help.Best regards
December 1, 2023 at 10:50 am #1426876Hey nebuddlho,
Thank you for the inquiry.
You can try this filter in the functions.php file to adjust the order of the post meta info.
add_filter('avf_post_metadata_array', function($meta, $context) { global $post; $cats = ''; $excluded_taxonomies = array_merge( get_taxonomies( array( 'public' => false ) ), array( 'post_tag', 'post_format' ) ); /** * * @since ???? * @since 4.8.8 added $context * @param array $excluded_taxonomies * @param string $post_type * @param int $post->ID * @param string $context * @return array */ $excluded_taxonomies = apply_filters( 'avf_exclude_taxonomies', $excluded_taxonomies, get_post_type( $post->ID ), $post->ID, 'loop-index' ); if ( ! empty( $taxonomies ) ) { foreach ( $taxonomies as $taxonomy ) { if ( ! in_array( $taxonomy, $excluded_taxonomies ) ) { $cats .= get_the_term_list( $post->ID, $taxonomy, '', ', ', '' ) . ' '; } } } $meta_cats = '<span class="blog-categories minor-meta">' . __( 'in', 'avia_framework') . ' '; $meta_cats .= trim( $cats ); $meta_cats .= '</span>'; $meta_info['categories'] = $meta_cats; $meta_author = '<span class="blog-author minor-meta">' . __( 'by', 'avia_framework' ) . ' '; $meta_author .= '<span class="entry-author-link" ' . avia_markup_helper( array( 'context' => 'author_name', 'echo' => false ) ) . '>'; $meta_author .= '<span class="author">'; $meta_author .= '<span class="fn">'; $meta_author .= get_the_author_posts_link(); $meta_author .= '</span>'; $meta_author .= '</span>'; $meta_author .= '</span>'; $meta_author .= '</span>'; $meta_info['date'] = $meta['date']; $meta_info['author'] = $meta_author; $meta_info['comments'] = ''; return $meta_info; }, 10, 2);
Best regards,
IsmaelDecember 1, 2023 at 3:01 pm #1426892Hello, thank you for the reply. I have tried adding the code but the meta information in search results is still the same.
December 4, 2023 at 3:59 am #1427092Hi,
Thank you for the update.
We may need to access the site in order to properly test the modification. Please provide the login details in the private field and make sure that the Appearance > Theme File Editor is accessible.
Best regards,
IsmaelDecember 4, 2023 at 3:24 pm #1427140I am sending the details below
December 5, 2023 at 7:44 am #1427195Hi,
Thank you for the info.
Please provide the login details in the private field and make sure that the Appearance > Theme File Editor is accessible.
The Appearance > Theme File Editor is not accessible, so we’re not able to edit the functions.php file. Please enable the editor back so that we can test the modification further. The documentation below should help.
// https://developer.wordpress.org/apis/wp-config-php/#disable-the-plugin-and-theme-file-editor
You should set DISALLOW_FILE_EDIT to false.
define( 'DISALLOW_FILE_EDIT', false );
Best regards,
IsmaelDecember 5, 2023 at 5:13 pm #1427234I am not sure how to enable the editor as the function is not doing anything, I will attach ftp details
December 8, 2023 at 3:40 am #1427524 -
AuthorPosts
- You must be logged in to reply to this topic.