Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Can’t display my code in any widget

Discussion in 'Misc WordPress Requests' started by HudsonValleyWebDesign, Feb 2, 2018.

  1. HudsonValleyWebDesign


    Reply To: Can’t display my code in any widget, by HudsonValleyWebDesign

    so you are using a child theme?
    in your child theme’s functions.php
    add require_once('includes/app-functions.php');
    create a folder named “includes” and a file named “app-functions.php”

    in that file:


    //enqueue app scripts and styles
    function the_app_scripts_styles() {

    // Loads shoutcast CSS file.
    wp_enqueue_style('shoutcast-theme', 'https://site.com/shoutcastinfo-ambient/css/darkVertical.css', false ,'');
    // Loads player CSS file.
    wp_enqueue_style('player-css', 'https://www.site.com/shoutcastinfo-ambient/player/clean.css', false ,'');
    // Loads FontAwesome CSS file.
    wp_enqueue_style('fontawesome-css', 'https://www.netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css', false ,'');
    // Loads google fonts CSS file.
    wp_enqueue_style('fonts-css', 'https://www.fonts.googleapis.com/css?family=Open+Sans:400,300,700&subset=latin,greek,vietnamese,cyrillic', false ,'');
    // Loads fancybox CSS file.
    wp_enqueue_style('fancybox-css', 'https://www.site.com/shoutcastinfo-ambient/js/fancybox/jquery.fancybox-1.3.0.css', false ,'');

    // Loads app JavaScript files.
    wp_enqueue_script('fancyboxJS', 'https://www.site.com/shoutcastinfo-ambient/js/fancybox/jquery.fancybox-1.3.0.pack.js', array('jquery'),'0', true );
    // Loads shoutcast main JavaScript files.
    wp_enqueue_script('shoutMain', 'https://www.site.com/shoutcastinfo-ambient/js/main.js', array('jquery'),'0', true );

    add_action('wp_enqueue_scripts', 'the_app_scripts_styles');

    then create a file in the child-theme folder named app.php

    <? php

    <!--start shoutcast javascripts-->
    var websiteUrl = 'https://www.site.com/shoutcastinfo-ambient/';//website url
    var showPlayer = '0';//show player status
    var shoutcastUrl = '';//shoutcast stream server url
    var autostartPlayer = false;//autostart player status
    var displayPlayer = 'top';//player area
    <!--end shoutcast javascripts-->

    <!--SHOUTCAST INFO AND STATS START - Add this in your page(s)-->
    <div id="statsOuter">
    <div id='playNow'>
    <!--show Shoutcast info and stats here-->
    <div id='hiddeNowPlay'>
    <!--hidden title-->

    make a duplicate of the page template that the radio pages are using and at the top add this or change what is there to this:

    /* Template Name: Radio-APP-Page

    somewhere in the page it will call the sidebar <?php get_sidebar();?>
    if you add this get_template_part( ‘app’ );

    go to the radio pages and select Radio-APP-Page as the page template and it will shot the app in the template –

    Reply To: Can’t display my code in any widget

Share This Page

Monarch Social Sharing Plugin