728x90

get_bloginfo( string $show = '', string $filter = 'raw' )

Retrieves information about the current site.

CONTENTS


Description #Description

Possible values for $show include:

  • ‘name’ – Site title (set in Settings > General)
  • ‘description’ – Site tagline (set in Settings > General)
  • ‘wpurl’ – The WordPress address (URL) (set in Settings > General)
  • ‘url’ – The Site address (URL) (set in Settings > General)
  • ‘admin_email’ – Admin email (set in Settings > General)
  • ‘charset’ – The "Encoding for pages and feeds" (set in Settings > Reading)
  • ‘version’ – The current WordPress version
  • ‘html_type’ – The content-type (default: "text/html"). Themes and plugins can override the default value using the ‘pre_option_html_type’ filter
  • ‘text_direction’ – The text direction determined by the site’s language. is_rtl() should be used instead
  • ‘language’ – Language code for the current site
  • ‘stylesheet_url’ – URL to the stylesheet for the active theme. An active child theme will take precedence over this value
  • ‘stylesheet_directory’ – Directory path for the active theme. An active child theme will take precedence over this value
  • ‘template_url’ / ‘template_directory’ – URL of the active theme’s directory. An active child theme will NOT take precedence over this value
  • ‘pingback_url’ – The pingback XML-RPC file URL (xmlrpc.php)
  • ‘atom_url’ – The Atom feed URL (/feed/atom)
  • ‘rdf_url’ – The RDF/RSS 1.0 feed URL (/feed/rdf)
  • ‘rss_url’ – The RSS 0.92 feed URL (/feed/rss)
  • ‘rss2_url’ – The RSS 2.0 feed URL (/feed)
  • ‘comments_atom_url’ – The comments Atom feed URL (/comments/feed)
  • ‘comments_rss2_url’ – The comments RSS 2.0 feed URL (/comments/feed)

Some $show values are deprecated and will be removed in future versions. These options will trigger the _deprecated_argument() function.

Deprecated arguments include:

  • ‘siteurl’ – Use ‘url’ instead
  • ‘home’ – Use ‘url’ instead

Parameters #Parameters

$show

(string) (Optional) Site info to retrieve. Default empty (site name).

Default value: ''

$filter

(string) (Optional) How to filter what is retrieved.

Default value: 'raw'


Top ↑

Return #Return

(string) Mostly string values, might be empty.


Top ↑

Source #Source

File: wp-includes/general-template.php

704

705

706

707

708

709

710

711

712

713

714

715

716

717

718

719

720

721

722

723

724

725

726

727

728

729

730

731

732

733

734

735

736

737

738

739

740

741

742

743

744

745

746

747

748

749

750

751

752

753

754

755

756

757

758

759

760

761

762

763

764

765

766

767

768

769

770

771

772

773

774

775

776

777

778

779

780

781

782

783

784

785

786

787

788

789

790

791

792

793

794

795

796

797

798

799

800

801

802

803

804

805

806

807

808

809

810

811

812

813

814

815

816

817

818

819

820

821

822

823

824

825

826

827

828

829

830

831

832

833

834

835

836

837

838

839

840

841

842

843

function get_bloginfo( $show = '', $filter = 'raw' ) {

    switch ( $show ) {

        case 'home': // DEPRECATED

        case 'siteurl': // DEPRECATED

            _deprecated_argument(

                __FUNCTION__,

                '2.2.0',

                sprintf(

                    /* translators: 1: 'siteurl'/'home' argument, 2: bloginfo() function name, 3: 'url' argument */

                    __( 'The %1$s option is deprecated for the family of %2$s functions. Use the %3$s option instead.' ),

                    '<code>' . $show . '</code>',

                    '<code>bloginfo()</code>',

                    '<code>url</code>'

                )

            );

            // Intentional fall-through to be handled by the 'url' case.

        case 'url':

            $output = home_url();

            break;

        case 'wpurl':

            $output = site_url();

            break;

        case 'description':

            $output = get_option( 'blogdescription' );

            break;

        case 'rdf_url':

            $output = get_feed_link( 'rdf' );

            break;

        case 'rss_url':

            $output = get_feed_link( 'rss' );

            break;

        case 'rss2_url':

            $output = get_feed_link( 'rss2' );

            break;

        case 'atom_url':

            $output = get_feed_link( 'atom' );

            break;

        case 'comments_atom_url':

            $output = get_feed_link( 'comments_atom' );

            break;

        case 'comments_rss2_url':

            $output = get_feed_link( 'comments_rss2' );

            break;

        case 'pingback_url':

            $output = site_url( 'xmlrpc.php' );

            break;

        case 'stylesheet_url':

            $output = get_stylesheet_uri();

            break;

        case 'stylesheet_directory':

            $output = get_stylesheet_directory_uri();

            break;

        case 'template_directory':

        case 'template_url':

            $output = get_template_directory_uri();

            break;

        case 'admin_email':

            $output = get_option( 'admin_email' );

            break;

        case 'charset':

            $output = get_option( 'blog_charset' );

            if ( '' == $output ) {

                $output = 'UTF-8';

            }

            break;

        case 'html_type':

            $output = get_option( 'html_type' );

            break;

        case 'version':

            global $wp_version;

            $output = $wp_version;

            break;

        case 'language':

            /* translators: Translate this to the correct language tag for your locale,

             * see https://www.w3.org/International/articles/language-tags/ for reference.

             * Do not translate into your own language.

             */

            $output = __( 'html_lang_attribute' );

            if ( 'html_lang_attribute' === $output || preg_match( '/[^a-zA-Z0-9-]/', $output ) ) {

                $output = determine_locale();

                $output = str_replace( '_', '-', $output );

            }

            break;

        case 'text_direction':

            _deprecated_argument(

                __FUNCTION__,

                '2.2.0',

                sprintf(

                    /* translators: 1: 'text_direction' argument, 2: bloginfo() function name, 3: is_rtl() function name */

                    __( 'The %1$s option is deprecated for the family of %2$s functions. Use the %3$s function instead.' ),

                    '<code>' . $show . '</code>',

                    '<code>bloginfo()</code>',

                    '<code>is_rtl()</code>'

                )

            );

            if ( function_exists( 'is_rtl' ) ) {

                $output = is_rtl() ? 'rtl' : 'ltr';

            } else {

                $output = 'ltr';

            }

            break;

        case 'name':

        default:

            $output = get_option( 'blogname' );

            break;

    }

 

    $url = true;

    if ( strpos( $show, 'url' ) === false &&

        strpos( $show, 'directory' ) === false &&

        strpos( $show, 'home' ) === false ) {

        $url = false;

    }

 

    if ( 'display' == $filter ) {

        if ( $url ) {

            /**

             * Filters the URL returned by get_bloginfo().

             *

             * @since 2.0.5

             *

             * @param mixed $output The URL returned by bloginfo().

             * @param mixed $show   Type of information requested.

             */

            $output = apply_filters( 'bloginfo_url', $output, $show );

        } else {

            /**

             * Filters the site information returned by get_bloginfo().

             *

             * @since 0.71

             *

             * @param mixed $output The requested non-URL site information.

             * @param mixed $show   Type of information requested.

             */

            $output = apply_filters( 'bloginfo', $output, $show );

        }

    }

 

    return $output;

}

Expand full source code View on Trac


Top ↑

Changelog #Changelog

ChangelogVersionDescription

0.71 Introduced.

Top ↑

More Information #More Information

Top ↑

Usage #Usage

1

$bloginfo = get_bloginfo( $show, $filter );


Top ↑

Top ↑

Uses #Uses

UsesUsesDescription

wp-includes/l10n.php: determine_locale()

Determine the current locale desired for the request.

wp-includes/theme.php: get_stylesheet_uri()

Retrieves the URI of current theme stylesheet.

wp-includes/theme.php: get_stylesheet_directory_uri()

Retrieve stylesheet directory URI.

wp-includes/theme.php: get_template_directory_uri()

Retrieve theme directory URI.

wp-includes/l10n.php: __()

Retrieve the translation of $text.

Show 9 more uses


Top ↑

Used By #Used By

Used ByUsed ByDescription

wp-includes/functions.php: is_wp_version_compatible()

Checks compatibility with the current WordPress version.

wp-admin/includes/class-wp-debug-data.php:WP_Debug_Data::debug_data()

Static function for generating site debug data when required.

wp-admin/includes/class-wp-site-health.php:WP_Site_Health::get_test_wordpress_version()

Tests for WordPress version and outputs it.

wp-admin/includes/class-wp-site-health.php:WP_Site_Health::get_test_https_status()

Test if your site is serving content over HTTPS.

wp-admin/includes/misc.php:WP_Privacy_Policy_Content::get_default_content()

Return the default suggested privacy policy content.

Show 63 more used by


Top ↑

User Contributed Notes #User Contributed Notes

  1. Skip to note 1 content

    You must log in to vote on the helpfulness of this noteVote results for this note:1You must log in to vote on the helpfulness of this note

    Contributed by Codex  4 years ago

    Default Usage
    The default usage assigns your blog’s title to the variable $blog_title.

    1

    <?php $blog_title = get_bloginfo(); ?>

    Log in to add feedback

  2. Skip to note 2 content

    You must log in to vote on the helpfulness of this noteVote results for this note:1You must log in to vote on the helpfulness of this note

    Contributed by Codex  4 years ago

    Blog Title
    This example assign your blog’s title to the variable $blog_title. This returns the same result as the default usage.

    1

    <?php $blog_title = get_bloginfo( 'name' ); ?>

    Log in to add feedback

  3. Skip to note 3 content

    You must log in to vote on the helpfulness of this noteVote results for this note:1You must log in to vote on the helpfulness of this note

    Contributed by Codex  4 years ago

    Blog Tagline
    Using this example:

    1

    <?php printf( esc_html__( 'Your Blog Tagline is: %s', 'textdomain' ), get_bloginfo ( 'description' ) ); ?><br />

    Results in this being displayed on your blog:

    Your Blog Tagline is: All things WordPress

    Log in to add feedback

  4. Skip to note 4 content

    You must log in to vote on the helpfulness of this noteVote results for this note:1You must log in to vote on the helpfulness of this note

    Contributed by Codex  4 years ago

    Network Tagline
    Using this example, you can obtain the name and description for the network home:

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    <?php

    switch_to_blog(1);

    $site_title = get_bloginfo( 'name' );

    $site_url = network_site_url( '/' );

    $site_description = get_bloginfo( 'description' );

    restore_current_blog();

    echo 'The Network Home URL is: ' . $site_url;

    echo 'The Network Home Name is: ' . $site_title;

    echo 'The Network Home Tagline is: ' . $site_description; 

    ?>

    results in this being displayed on your blog:

    The Network Home URL is: http://example.com/
    The Network Home Name is: Example
    The Network Home Tagline is: The example site

    Log in to add feedback

  5. Skip to note 5 content

    You must log in to vote on the helpfulness of this noteVote results for this note:0You must log in to vote on the helpfulness of this note

    Contributed by mslade  2 years ago

    The comments regarding `get_bloginfo(‘url’)` are misleading. It will *not* necessarily return what is set in Settings > General. The protocol (“http” or “https”) will be determined by the value of `is_ssl()`, which detects if the current request is over SSL or not.

    Log in to add feedback

  6. Skip to note 6 content

    You must log in to vote on the helpfulness of this noteVote results for this note:0You must log in to vote on the helpfulness of this note

    Contributed by Rehmat  1 year ago

    There should be a possibility to return the array of all available info. Although this might not be a good practice in terms of performance this should help someone who needs to fetch all info about a website. Note that I’ve omitted some fields that might not be that important:

    1

    2

    3

    4

    5

    6

    7

    8

    function bloginfo_array() {

        $fields = array('name', 'description', 'wpurl', 'url', 'admin_email', 'charset', 'version', 'html_type', 'text_direction', 'language');

        $data = array();

        foreach($fields as $field) {

            $data[$field] = get_bloginfo($field);

        }

        return $data;

    }

'WEB > WP(WordPress)' 카테고리의 다른 글

DIVI TUTORIAL – CENTER ALIGN MULTIPLE BUTTONS  (0) 2019.05.23
How to Vertically Align Content in Divi  (0) 2019.05.23
The Divi Button Module  (0) 2019.05.22
MangBoard  (0) 2019.05.22
How to add JavaScript & jQuery code to Divi Theme  (0) 2019.05.20
728x90

VIEW A LIVE DEMO OF THIS MODULE

How To Add A Button Module To Your Page

Before you can add a button module to your page, you will first need to jump into the Divi Builder. Once the Divi Theme has been installed on your website, you will notice a Use Divi Builder button above the post editor every time you are building a new page. Clicking this button will enable the Divi Builder, giving you access to all of the Divi Builder’s modules. Next, click the Use Visual Builder button to launch the builder in Visual Mode. You can also click the Use Visual Builder button when browsing your website on the front end if you are logged in to your WordPress Dashboard.

Once you have entered the Visual Builder, you can click the gray plus button to add a new module to your page. New modules can only be added inside of Rows. If you are starting a new page, don’t forget to add a row to your page first. We have some great tutorials about how to use Divi’s row and section elements.

Locate the button module within the list of modules and click it to add it to your page. The module list is searchable, which means you can also type the word “button” and then click enter to automatically find and add the button module! Once the module has been added, you will be greeted with the module’s list of options. These options are separated into three main groups: Content, Design and Advanced.

Use Case Example: Adding a CTA Button to the Hero Section of a Landing Page.

There are countless ways to use the Button Module. For this example, I’m going to show you how to add a “learn more” button to the hero section of a landing page.

Let’s get started.

Use the visual builder to add a Standard Section with a fullwidth (1 column) layout. Add a Text Module to add and style the Headline and Subheadline. Then add the Button Module directly under the Text Module.

Update the Module Settings as follows:

Content tab

Button Text: Learn More
Button URL: [enter URL]

Design tab
Button alignment: Center
Text Color: Light
Use Custom Styles for Button: YES
Button Text Size: 20px
Button Text Color: #ffffff
Button Background Color: #0065cb
Button Border Width: 9px
Button Border Color: #0065cb
Button Border Radius: 100px
Button Letter Spacing: 2px
Button Font: Source Sans, Bold, Uppercase
Button Hover Letter Spacing: 2px

That’s it! This is just one of the countless ways you can use the button module.

Button Content Options

Within the content tab you will find all of the module’s content elements, such as text, images and icons. Anything that controls what appears in your module will always be found within this tab.

Button Text

Input your desired button text.

Button URL

Input the destination URL for your button.

URL Opens

Here you can choose whether or not your link opens in a new window.

Admin Label

This will change the label of the module in the builder for easy identification. When using WireFrame view in the Visual Builder, these labels will appear within the module block in the Divi Builder interface.

Button Design Options

Within the design tab you will find all of the module’s styling options, such as fonts, colors, sizing and spacing. This is the tab you will use to change how your module looks. Every Divi module has a long list of design settings that you can use to change just about anything.

Button Alignment

Here you can choose to have your button aligned to the left, right or center.

Text Color

Here you can choose whether your text should be light or dark. If you are working with a dark background, then your text should be light. If your background is light, then your text should be set to dark.

Use Custom Styles for Button

Enabling this option will reveal various button customization settings that you can use to change the appearance of your module’s button.

Button Text Size

This setting can be used to increase or decrease the size of the text within the button. The button will scale as the text size is increased and decreased.

Button Text Color

By default, buttons assume your theme accent color as defined in the Theme Customizer. This option allows you to assign a custom text color to the button in this module. Select your custom color using the color picker to change the button’s color.

Button Background Color

By default, buttons have a transparent background color. This can be changed by selected your desired background color from the color picker.

Button Border Width

All Divi buttons have a 2px border by default. This border can be increased or decreased in size using this setting. Borders can be removed by inputting a value of 0.

Button Border Color

By default, button borders assume your theme accent color as defined in the Theme Customizer. This option allows you to assign a custom border color to the button in this module. Select your custom color using the color picker to change the button’s border color.

Button Border Radius

Border radius affects how rounded the corners of your buttons are. By default, buttons in Divi has a small border radius that rounds the corners by 3 pixels. You can decrease this to 0 to create a square button or increase it significantly to create buttons with circular edges.

Button Letter Spacing

Letter spacing affects the space between each letter. If you would like to increase the space between each letter in your button text, use the range slider to adjust the space or input your desired spacing size into the input field to the right of the slider. The input fields supports different units of measurement, which means you can input “px” or “em” following your size value to change its unit type.

Button Font

You can change the font of your button text by selecting your desired font from the dropdown menu. Divi comes with dozens of great fonts powered by Google Fonts. By default, Divi uses the Open Sans font for all text on your page. You can also customize the style of your text using the bold, italic, all-caps and underline options.

Add Button Icon

Disabled this setting will remove icons from your button. By default, all Divi buttons display an arrow icon on hover.

Button Icon

If icons are enabled, you can use this setting to pick which icon to use in your button. Divi has various icons to choose from.

Button Icon Color

Adjusting this setting will change the color of the icon that appears in your button. By default, the icon color is the same as your buttons’ text color, but this setting allows you to adjust the color independently.

Button Icon Placement

You can choose to have your button icon display on the left or the right side of your button.

Only Show Icon On Hover for Button

By default, button icons are only displayed on hover. If you would like the icon to always appear, disable this setting.

Button Hover Text Color

When the button is hovered over by a visitor’s mouse, this color will be used. The color will transition from the base color defined in the previous settings.

Button Hover Background Color

When the button is hovered over by a visitor’s mouse, this color will be used. The color will transition from the base color defined in the previous settings.

Button Hover Border Color

When the button is hovered over by a visitor’s mouse, this color will be used. The color will transition from the base color defined in the previous settings.

Button Hover Border Radius

When the button is hovered over by a visitor’s mouse, this value will be used. The value will transition from the base value defined in the previous settings.

Button Hover Letter Spacing

When the button is hovered over by a visitor’s mouse, this value will be used. The value will transition from the base value defined in the previous settings.

Button Advanced Options

Within the advanced tab, you will find options that more experienced web designers might find useful, such as custom CSS and HTML attributes. Here you can apply custom CSS to any of the module’s many elements. You can also apply custom CSS classes and IDs to the module, which can be used to customize the module within your child theme’s style.css file.

CSS ID

Enter an optional CSS ID to be used for this module. An ID can be used to create custom CSS styling, or to create links to particular sections of your page.

CSS Class

Enter optional CSS classes to be used for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated with a space. These classes can be used in your Divi Child Theme or within the Custom CSS that you add to your page or your website using the Divi Theme Options or Divi Builder Page Settings.

Custom CSS

Custom CSS can also be applied to the module and any of the module’s internal elements. Within the Custom CSS section, you will find a text field where you can add custom CSS directly to each element. CSS input into these settings are already wrapped within style tags, so you need only enter CSS rules separated by semicolons.

Button Relationship

Here you can define a custom rel attribute for the button, such as rel=”nofollow.” Divi lets you pick from all of the most common link attributes.

Visibility

This option lets you control which devices your module appears on. You can choose to disable your module on tablets, smart phones or desktop computers individually. This is useful if you want to use different modules on different devices, or if you want to simplify the mobile design by eliminating certain elements from the page.

'WEB > WP(WordPress)' 카테고리의 다른 글

How to Vertically Align Content in Divi  (0) 2019.05.23
get_bloginfo  (0) 2019.05.22
MangBoard  (0) 2019.05.22
How to add JavaScript & jQuery code to Divi Theme  (0) 2019.05.20
mysql UPDATE 이용시에 쌍따옴표 검색가능할까요?  (0) 2019.05.20
728x90

망보드 소개

망보드 WP는 워드프레스 플러그인 형태로 제공되는 프로그램으로 자료실, 갤러리, 캘린더, 회원관리, 쇼핑몰, 소셜 로그인, 소셜공유, 검색엔진최적화 등의 다양한 기능을 제공합니다.

망보드는 웹에서 모바일앱까지 한번에 제작할 수 있도록 개발되어 필요에 따라 회원관리(비즈니스 패키지), 쇼핑몰(커머스 패키지), 모바일앱(모바일 패키지) 등의 기능을 추가해서 사용할 수 있고, 모든 기능이 하나의 플러그인으로 통합되어 빠른 속도로 동작합니다.

망보드의 장점

  • 빠르게 변화하는 기술, 플랫폼에 보다 쉽게 대응할 수 있다
  • 커스트마이징을 위한 게시판으로 구조를 쉽게 변형할 수 있다
  • 데스크탑, 태블릿, 모바일 등 다양한 디바이스에 맞는 반응형웹 구축이 가능하다
  • 플러그인 기능을 통해 다양한 기능을 추가할 수 있다
  • 다국어 기능 및 보안 인증서(SSL) 기능을 지원한다

망보드 버젼별 특징

베이직 : MB-BASIC

  • 기능: 자료실, 갤러리, 캘린더, 웹진, 문의하기, 자주묻는질문 게시판
  • 특징: 다양한 확장 기능들이 모듈로 분리되어 있어 언제든지 쉽고 빠르게 원하는 기능을 추가해서 사용하실 수 있습니다
  • 다운로드: https://www.mangboard.com/download/

비즈니스(회원관리) 패키지 : MB-BUSINESS

  • 기능: 소셜 로그인, 소셜 공유, 검색 최적화 기능(SEO), 회원 관리(로그인, 회원가입, 회원정보 등)
  • 특징: 망보드 소셜로그인 기능은 중간에 다른 서버를 거치지 않기 때문에 보다 안전하게 이용하실 수 있습니다
  • 다운로드: https://www.mangboard.com/store/?vid=91
  • 다운로드(소셜): https://www.mangboard.com/store/?vid=9

커머스(쇼핑몰) 패키지 : MB-COMMERCE

  • 기능: 상품관리, 카트, 관심상품, 결제, 주문관리 기능 등
  • 특징: 망보드 기반으로 개발되어 다른 워드프레스 쇼핑몰에 비해 가볍고 빠른 속도로 동작합니다
  • 다운로드: https://www.mangboard.com/store/?vid=10

테마 패키지 : MB-THEME

모바일 패키지 : MB-MOBILE

  • 기능: 망보드에서 제공하는 게시판,회원관리,쇼핑몰 기능을 하이브리드 모바일앱으로 제공
  • 특징: 모바일 패키지는 주문제작 형태로만 지원(안드로이드, IOS)
  • 제작문의: https://www.mangboard.com/order/?idx=4

에디터 패키지 : MB-EDITOR

망보드 게시판 무료 스킨

자료실 게시판

갤러리 게시판

캘린더 게시판

웹진 게시판

문의하기 게시판

자주묻는질문 게시판

망보드 게시판 설치하기

1. 망보드 플러그인 설치파일을 워드프레스 "/wp-content/plugins" 폴더에 업로드 합니다

  (워드프레스 플러그인 검색에서 "mangboard"로 검색해서 설치도 가능합니다)

 

2. 관리자 화면에서 "플러그인>설치된 플러그인" 목록에서 "MangBoard WP" 플러그인을 찾아 활성화 버튼을 클릭합니다

 

3. 망보드 플러그인에서 비활성화 버튼이 보이면 정상적으로 플러그인 활성화 됩니다.

 

4. 망보드에서 파일 업로드를 하기 위해서는 wp-content 폴더의 권한을 757로 설정하셔야 합니다

망보드 게시판 추가하기

1. MangBoard 메뉴에서 게시판 관리 메뉴를 클릭합니다

 

2. 우측하단에 게시판 추가 버튼을 클릭해 게시판 추가화면으로 이동합니다

 

3. 게시판 이름을 board1로 입력하고, 나머지 설정을 입력한 후 확인 버튼을 클릭해 게시판을 추가합니다

 

4. 추가된 게시판 목록에서 [mb_board name="board1" style=""]  Shortcode를 복사합니다

 - 자료실 게시판 숏코드 [mb_board name="board1" style=""]

 - 갤러리 게시판 숏코드 [mb_board name="board1" list_type="gallery" style=""]

 - 캘린더 게시판 숏코드 [mb_board name="board1" list_type="calendar" style=""]

 - 웹진 게시판: 자료실 게시판 숏코드 - webzine 모델 설정

 - 문의하기 게시판: 자료실 게시판 숏코드 - form 모델 설정(문의내용 작성시 관리자 메일로 전송)

 - 자주 묻는 질문 게시판: 자료실 게시판 숏코드 - faq 모델 설정

 

5. 관리자 메뉴에서 페이지>새 페이지 추가 메뉴를 클릭해서 새 페이지 추가 화면으로 이동합니다
  에디터에 게시판 Shortcode를 붙여 넣고, 공개하기 버튼을 클릭해 망보드 게시판과 페이지를 연결합니다.

 

6. 관리자 메뉴에서 외모>메뉴 메뉴를 클릭해 메뉴 편집 화면으로 이동합니다

  새로 추가한 자료실 게시판을 선택하고 메뉴에 추가 버튼을 클릭해 메인 메뉴에 추가한 다음 메뉴 저장 버튼을 클릭합니다

 

7. 홈페이지에서 추가한 자료실 게시판 메뉴를 클릭하고, 자료실 게시판이 보이면 정상적으로 게시판 추가가 완료되었습니다

설치방법 및 게시판 추가 동영상

 

728x90

Adding custom scripts to Divi

Let’s say you’ve found a JavaScript (or jQuery, which is the “Write Less, Do More” JavaScript library) code snippet and you’d like to include it in your Divi website. There is a few ways you can go about doing it. One of options would be to use the Code Module.

Option 1 – Code Module

You need to make sure your code is wrapped in <script> </script> tags. Simply paste your code in the Code Module, like this:

 

 

 

  •  

  •  

  •  

  •  

  •  

 

 

 

This is the code used in the example above:

<script> jQuery(function($){ alert('Hi! This is working!'); }); </script>

Using Code Module is a good option if you want your code to run only on one specific page. But if you want your code to run on every page, it would be better to add it to the <head> tag of your website via Theme Options.

Option 2 – Divi Theme Options

To add a code to every page navigate to Divi Theme Options > Integration tab.  Make sure the “Enable header code” option is checked, and paste your code below.

 

 

 

  •  

  •  

  •  

  •  

  •  

 

 

 

You can also place your code in a file with JS extension (e.g. my-scripts.js) and use this method to include it. You would need to login to your WordPress site via FTP or cPanel, whichever method you prefer. If you’re using cPanel, go to File Manager to access your site’s files. Locate your child theme folder and create a js folder in it and upload your file inside of this folder. The url for your file will look something like this: http://yoursite.com/wp-content/themes/yourchildtheme/js/my-scripts.js

To get your site to load external JS file (e.g. your own code or some jQuery plugin) add a code like this with modified url source.

<script src="http://yoursite.com/wp-content/themes/yourchildtheme/js/my-scripts.js"></script>

  •  

  •  

  •  

  •  

  •  

The last method is a bit more advanced, but it is the approach recommended by WordPress.

Option 3 – Enqueuing scripts via functions.php

With this example I’m assuming you are using a Divi Child Theme and you uploaded your scripts file to “js” folder inside your child theme files. You can add the code below to your functions.php file:

function mycustomscript_enqueue() { wp_enqueue_script( 'custom-scripts', get_stylesheet_directory_uri() . '/js/my-scripts.js' ); } add_action( 'wp_enqueue_scripts', 'mycustomscript_enqueue' );

If your script relies on jQuery library you can modify it like this to make sure jQuery will be loaded as well:

function mycustomscript_enqueue() { wp_enqueue_script( 'custom-scripts', get_stylesheet_directory_uri() . '/js/my-scripts.js', array( 'jquery' )); } add_action( 'wp_enqueue_scripts', 'mycustomscript_enqueue' );

Just don’t forget to change this code to match your file name.

And that’s it – you’ve successfully loaded custom JavaScript to your divi website 🙂

+ Recent posts