Code Monkey home page Code Monkey logo

wordpress-vuejs-search's People

Contributors

karannagupta avatar nuancedesignstudio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wordpress-vuejs-search's Issues

Term_links, Terms, Custom_excerpt return empty

WpPosts vue_meta term links, terms and excerpts are empty and displayed posts are all uncategorized even though they have associated taxonomy of terms and categories. At first get_term_link was returning empty and producing a cannot convert to string error, but I managed to solve that by using $term_data->slug instead of name. A var_dump of $additional_post_data returns the correct info when looking at a post in the editor:

(size=5)
'custom_excerpt' => string 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam lobortis magna ut tellus vehicula malesuada eu eget turpis. Lorem ipsum dolor sit amet, consectetur adipiscing โ€ฆ' (length=182)
'terms' =>
array (size=2)
0 => string 'design' (length=6)
1 => string 'dev' (length=3)
'term_links' =>
array (size=2)
0 => string 'design' (length=54)
1 => string 'dev' (length=48)
'featuredmedia_alt' => string 'Beachy City' (length=11)
'featuredmedia_url' => string '//localhost:3002/app/uploads/2020/05/d8db3e70-f8c0-383b-9c7c-2f23a8031043.jpg' (length=77)

The array on the post editor page contains the term_links, terms, and custom_excerpt.

When looking in postman I get a lot of errors for extend-api.php on lines 45 and 60.

/wp-json/wp/v2/posts?per_page=100&page=1&_fields=id,title,link,vue_meta

Notice: Undefined index: categories in /var/www/public/wp-content/themes/vuetwentyseventeen/includes/extend-api.php on line 45

Warning: Invalid argument supplied for foreach() in /var/www/public/wp-content/themes/vuetwentyseventeen/includes/extend-api.php on line 45

Looks like it is having issues with the forEach loop
Further down the response in postman There are cannot modify header information headers already sent errors. I don't know if the data is available at the time it starts the loop and the excerpt property seems to also be unavailable, but for some reason the image data for the post is available

Any help in resolving this would be appreciated. Thank you.

Warning: Cannot modify header information - headers already sent by (output started at /var/www/public/wp-content/themes/vuetwentyseventeen/includes/extend-api.php:45) in /var/www/public/wp-includes/rest-api/class-wp-rest-server.php on line 1337

Can't access the wordpress local data inside vuejs

I can't access the local WordPress data in Vuejs. I followed all your instructions which are given about but it's not working for me. Please help me to how to slove it

wordpress code -

get_stylesheet_directory_uri(), 'rest_url' => untrailingslashit( esc_url_raw( rest_url() ) ), // URL to the REST endpoint. 'app_path' => '$post->post_name', // page where the custom page template is loaded. 'post_categories' => get_terms( array( 'taxonomy' => 'category', // default post categories. 'hide_empty' => true, 'fields' => 'names', ) ), ) ); // enqueue the Vue app script with localized data. wp_enqueue_script( 'vue_search_app' ); //} } VueJs code - App.Vue ----------------------------------------------------- data() { return { wpData: wpData, } } ** When I access this wpData it's shown me an error and undefined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.