mrvigner
Forum Replies Created
-
Forum: Plugins
In reply to: [Web Stories] Video Failed to Play@swissspidy Thanks for the tip. It turned out that there was an address with the http protocol in the site settings. Although the site itself was on https for a long time. I changed the protocol settings to https and now everything works.
Forum: Plugins
In reply to: [Web Stories] Video Failed to PlayI have the same problem:
https://nabuduvaly.com/web-stories/dvoryk-zk-na-shaslyvomu/Video access rights are normal:
[video src="https://nabuduvaly.com/wp-content/uploads/2023/07/Dvir_ZK-Na-Shaslyvomu.webm" /]
Content of the file with access logs after opening the history page:
91.223.227.204 - - [28/Jul/2023:12:44:38 +0300] "GET /web-stories/dvoryk-zk-na-shaslyvomu/ HTTP/1.0" 200 6967 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
I noticed that in the source code of the story page, the video is embedded using the https:// protocol instead of https:// . Maybe this is the problem? And if so, how to fix it?
My theme’s functions.php?
Yes.
Does this mean that it will include aggregaterating from KK Star Ratings into Rank Math’s recipe rich snippet?
Yes.
Forum: Plugins
In reply to: [Simple Local Avatars] Form output to front endI created user pages. Successfully brought a change of name, mail, passwords. I would also like to add avatar changes, but just pulling the code from the plugin does not work ??
I found where the necessary data is stored in the database and pulled them up. Maybe someone will come in handy:
<? add_filter( "rank_math/snippet/rich_snippet_recipe_entity", function( $entity ) { $id = get_the_ID(); $i = get_post_meta($id, '_kksr_casts', true ); $sumstar = get_post_meta($id, '_kksr_ratings', true ); $star = round($sumstar / $i); $entity['aggregateRating'] = [ "@type" => "AggregateRating", "ratingValue" => "$star", "reviewCount" => "$i", ]; return $entity; }); ?>
Or, if I understand correctly, the instructions for the following attributes should remove the markup leaving only the text?
https://developer.www.ads-software.com/block-editor/developers/block-api/block-attributes/#text
sd
blocks.registerBlockType( 'ingredients/shortcode', { title: __( 'Ingredients' ), icon: 'index-card', category: 'widgets', attributes: { content: { type: 'string', source: 'text', selector: '.ingredients' } },
- This reply was modified 4 years, 10 months ago by mrvigner.
Do I understand correctly: in the function “edit” I now need to cut out the text from the html code in order to finally get in the block in the editor “line <br> line <br> line <br>”?
So that later the save function could convert “line<br>line<br>line<br>” back to the code required on the front-end?
@mattyrob The only error found – “the block editor requires javascript. please enable javascript in your browser settings or try the Classic editor plugin.”
Present only when editing those entries where this widget is inserted ??
@mattyrob Thanks, it worked!
True, when adding a new article it works. And if you then try to edit an article that has this block – an empty white page instead of an editor.
Now I’ll try to look at the logs for errors.
I tried it <br/> instead of <br>, because it didn’t work, and in the source code of the editor it was clear that it put <br/> when I do the transfer. But that is not the problem….
@mattyrob Thanks for the help. I tried to apply your code, but for some reason, saving the text entered in the block does not work.
Here is the complete block.js code with the implementation of your solution:
( function( blocks, editor, i18n, element, components, _ ) { var __ = i18n.__; var el = element.createElement; var RichText = editor.RichText; blocks.registerBlockType( 'gutenberg-examples/recipe-ingredient', { title: __( 'Ingredients', 'gutenberg-examples' ), icon: 'index-card', category: 'layout', attributes: { ingredients: { type: 'array', source: 'children', selector: '.ingredients', }, }, edit: function( props ) { var attributes = props.attributes; return el( 'div', { className: props.className }, el( RichText, { tagName: 'ul', placeholder: i18n.__( 'Write a list of ingredients…', 'gutenberg-examples' ), value: attributes.ingredients, onChange: function( value ) { props.setAttributes( { ingredients: value } ); }, className: 'ingredients', } ) ); }, save: function( props ) { var attributes = props.attributes; var ingredients = attributes.ingredients.split( '<br/>' ); var content = ''; var openspan = '<span class="check--label-box"></span><span class="check--label-text">'; var closetags = '</span><label></li>'; var len = ingredients.length; for ( var i = 0; i < len; i++) { content = content + '<li class="list-item' + ( i + 1 ) + '">'; content = content + '<input type="checkbox" class="hidden-box" id="ingr' + ( i + 1 ) + '">'; content = content + '<label for="ingr' + ( i + 1 ) + '" class="check--label">'; content = content + openspan + ingredients[i] + closetags; } return el( 'div', { className: props.className }, el( editor.RichText.Content, { tagName: 'ul', className: 'list', value: content, } ) ); }, } ); } )( window.wp.blocks, window.wp.editor, window.wp.i18n, window.wp.element, window.wp.components, window._ );
Am I doing something wrong?
- This reply was modified 4 years, 10 months ago by mrvigner.
Forum: Plugins
In reply to: [Rank Math SEO – AI SEO Tools to Dominate SEO Rankings] Recipe rich snippetThanks @rankmath ! The solution you proposed helped me too. ??