Tag: News

  • Getting a little fed up: I cannot easily share on WP

    With the “death of Twitter,” and social media in general, I’d like to take back my content. It’s just not currently easy to share content to my blog.

    Getting a little fed up: I cannot easily share on WP
  • News page added back to website

    The News page has been added back to the website. Some news sources were removed as they often produced RSS errors or the headlines were simply too bombastic or misleading by my standards.

    On the tech side of it, I did have to add some JavaScript to the native WordPress RSS widgets, so that I links opened in a new tab, etc., below is the code snippet:

    <script>
        // Open link in new tab
        let link = document.querySelectorAll('.wp-block-rss__item a')
        link.forEach((e) => {
            e.setAttribute("target", "_blank")
        })
    
        // Add inline style to the <ul>
        let news_list = document.querySelectorAll("ul.wp-block-rss")
        news_list.forEach((e) => {
            e.setAttribute("style", "list-style-type:none; margin: 1rem auto;");
        })
    
        // Make the title inline
        let wp_block_rss_item_title = document.querySelectorAll('div.wp-block-rss__item-title')
        wp_block_rss_item_title.forEach((e) => {
            e.setAttribute("style", "display:inline-block!important;");
        })
    
        // Style the publish date
        let wp_block_rss_item_publish_date = document.querySelectorAll('.wp-block-rss__item-publish-date')
        wp_block_rss_item_publish_date.forEach((e) => {
            e.setAttribute("style", "display:inline-block!important; font-weight:bold; margin:0 8px;")
        })
    </script>
    News page added back to website