matthisco
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Permalinks 404 errorThanks for the reply.
I’ve done that, recreated my .htaccess file to this:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
I still get a 404 when I try and use a permalink, any ideas?
Not Found The requested URL /venepuncture-venipuncture-tomorrows-clinicians-2/ was not found on this server. Apache/2.4.18 (Ubuntu) Server at xxxx Port 80
Forum: Developing with WordPress
In reply to: How to store question data for quiz app in wpThanks again for the reply. I have added all my custom fields. Is there a way I can store them in an array of objects called
questions
? There will be 15 questions in total.I need each
question
like this:question = [{ question: '' answers: '' correctAnswer: '' }]
Here is my functions.php:
// question1 register_rest_field('post', 'question1', array( 'get_callback' => 'post_get_meta_cb', 'update_callback' => 'post_update_meta_cb', 'schema' => null ) ); register_rest_field('post', 'answers1', array( 'get_callback' => 'post_get_meta_cb', 'update_callback' => 'post_update_meta_cb', 'schema' => null ) ); register_rest_field('post', 'correctAnswer1', array( 'get_callback' => 'post_get_meta_cb', 'update_callback' => 'post_update_meta_cb', 'schema' => null ) ); // question2 register_rest_field('post', 'question2', array( 'get_callback' => 'post_get_meta_cb', 'update_callback' => 'post_update_meta_cb', 'schema' => null ) ); register_rest_field('post', 'answers2', array( 'get_callback' => 'post_get_meta_cb', 'update_callback' => 'post_update_meta_cb', 'schema' => null ) ); register_rest_field('post', 'correctAnswer2', array( 'get_callback' => 'post_get_meta_cb', 'update_callback' => 'post_update_meta_cb', 'schema' => null ) );
- This reply was modified 5 years, 9 months ago by matthisco.
Forum: Developing with WordPress
In reply to: How to store question data for quiz app in wpThanks for the reply.
Could I not just add questions and an answer as a custom field for each post?
Questions could be a string, answers could be a comma separated list and the correct answer could be an int as the index for the answers.
Forum: Fixing WordPress
In reply to: Permalink problem, postname 404 errorCase sensitive issue
Forum: Developing with WordPress
In reply to: Editing api response, where to start?I have tried to create a new endpoint by adding this to functions.php, by passing a parameter:
function allow_compact_event( $data, $event, $request ) { // return compact data when _compact GET parameter exists if(isset($_GET['_compact'])){ return [ 'id' => $data->data['id'], 'title' => $data->data['title']['rendered'], 'link' => $data->data['link'], ]; } return $data; } add_filter( 'rest_prepare_event', 'allow_compact_event', 10, 3 );
However, all the data comes down instead of the id, title, link. It doesn’t seem to work.
Any ideas?
- This reply was modified 7 years, 2 months ago by matthisco.
Forum: Plugins
In reply to: [The Events Calendar] Events calendar, change format of api jsonMoved to relevant forum
- This reply was modified 7 years, 2 months ago by matthisco.
Forum: Themes and Templates
In reply to: Twentytwelve Theme – primary div 100% widthThankyou
Forum: Fixing WordPress
In reply to: Linking to pages in wordpress installationMany thanks for your reply.
I have a basic site setup.
Do you know how I can add a search box to the site so I can search an area by postcode for locations?
Forum: Fixing WordPress
In reply to: Linking to pages in wordpress installationThanks very much for your reply again.
Do you now how I can populate the plugin with my example locations above?
Many thanks
Forum: Fixing WordPress
In reply to: Linking to pages in wordpress installationMany thanks for your reply.
I have this page here:
https://www.mharrisweb.co.uk/maps/map.html
I would like to include it in my wordpress cms.
any advice much appreciated.
Forum: Fixing WordPress
In reply to: Site is down, error 404.All fixed now folks.
I reinstalled the site and it works fine.
Thanks
Forum: Fixing WordPress
In reply to: Site is down, error 404.UPDDATE: I can see the page if I wait long enough, but there is no CSS.
Forum: Themes and Templates
In reply to: Singular layout problemHaha, dont worry, thats just so I can see what the div’s are doing while I fix it! ??
Forum: Fixing WordPress
In reply to: Can a mod please delete the URL's from my following threads?I don’t want you to delete my posts just edit my post to delete the address to my examples
The code has changed and pages aren’t the Same anyway so the link to the examples is useless anyway
The threads will still be accessible in Google but the links won’t appear to my examples in any of the threads, its the link that is the problem I promise I won’t ask again in the future
Forum: Fixing WordPress
In reply to: Can a mod please delete the URL's from my following threads?Thanks for the reply.
Is there anychance you could just take out just the original link I posted please, and not the post itself? A client doesnt want there site in google, I didn’t realise the post would show up in Google when originally posted. I won’t post links again in the future which are sensitive.