• 04-10-2024, 11:56:05
    #1
    Arkadaşlar selamlar,

    Wordpress Dipnot Rakamı başına [] ifadesi nasıl koyarım dosya nerede bir türlü bulamadım.

    Şimdiden teşekkürler.
  • 04-10-2024, 12:02:38
    #2
    Dipnot rakamı nedir hocam
  • 04-10-2024, 12:12:45
    #3
    depresanz adlı üyeden alıntı: mesajı görüntüle
    Dipnot rakamı nedir hocam
    Wordpress yazı aracında dipnot ekliyoruz ya;
  • 04-10-2024, 12:50:44
    #4
    tema function a yapıştır

    function custom_editor_script() {
        ?>
        <script type="text/javascript">
            document.addEventListener('DOMContentLoaded', function () {
                if (typeof wp !== 'undefined' && typeof wp.data !== 'undefined') {
                    wp.data.subscribe(function () {
                        const blocks = wp.data.select('core/block-editor').getBlocks();
                        blocks.forEach(block => {
                            if (block.name === 'core/footnote') {
                                let newContent = `[${block.attributes.content}]`;
                                if (block.attributes.content !== newContent) {
                                    wp.data.dispatch('core/block-editor').updateBlockAttributes(block.clientId, {
                                        content: newContent
                                    });
                                }
                            }
                        });
                    });
                }
            });
        </script>
        <?php
    }
    add_action('admin_footer', 'custom_editor_script');
  • 04-10-2024, 13:14:57
    #5
    WebPerformans adlı üyeden alıntı: mesajı görüntüle
    tema function a yapıştır

    function custom_editor_script() {
        ?>
        <script type="text/javascript">
            document.addEventListener('DOMContentLoaded', function () {
                if (typeof wp !== 'undefined' && typeof wp.data !== 'undefined') {
                    wp.data.subscribe(function () {
                        const blocks = wp.data.select('core/block-editor').getBlocks();
                        blocks.forEach(block => {
                            if (block.name === 'core/footnote') {
                                let newContent = `[${block.attributes.content}]`;
                                if (block.attributes.content !== newContent) {
                                    wp.data.dispatch('core/block-editor').updateBlockAttributes(block.clientId, {
                                        content: newContent
                                    });
                                }
                            }
                        });
                    });
                }
            });
        </script>
        <?php
    }
    add_action('admin_footer', 'custom_editor_script');
    olmadı hocam
  • 04-10-2024, 17:20:37
    #6
    function custom_tinymce_settings($initArray) {
    $initArray['setup'] = 'function(editor) {
    editor.on("keypress", function(event) {
    if (event.charCode >= 49 && event.charCode <= 57 && event.shiftKey == false) { // 1 to 9 keys
    var content = editor.getContent();
    editor.setContent(content.replace(/(d)/g, "[$1]"));
    }
    });
    }';
    return $initArray;
    }
    add_filter('tiny_mce_before_init', 'custom_tinymce_settings');
    Bunu deneyin.
  • 04-10-2024, 17:24:50
    #7
    Eklenti ile çözüm düşünülürse: https://wordpress.org/plugins/footnotes-made-easy/