wordpress-theming

“Uncaught TypeError: $ is not a function” in WordPress [duplicate]

非 Y 不嫁゛ 提交于 2019-12-11 05:31:36
问题 This question already has answers here : TypeError: $ is not a function WordPress (11 answers) Closed last year . There are some questions about this error, but I couldn't find any solutions on them. I'm developing a WordPress theme and during the enqueue script this error came up: Uncaught TypeError: $ is not a function at components.js?ver=4.8:65 at components.js?ver=4.8:95 here is my enqueue code add to the functions.php: function goc_scripts() { wp_enqueue_style( 'goc-style', get

Wordpress pages theme/layout

痴心易碎 提交于 2019-12-11 04:39:51
问题 I'd like to know whether I could have different layout and content for each page? For example, I have 4 pages, and I have 4 completely different layout design, do I need to make 4 themes then apply to different pages or something else? Moreover, can I have different posts show on different page? like post no.1/or tag [google] goes to page 1, post no.5/tag[orange] goes to page 3? I'd like to learn how to structure this idea. Many thanks 回答1: make the diffrent template for different pages to

Adding Menu Support to Custom Wordpress Theme

一个人想着一个人 提交于 2019-12-11 04:16:24
问题 I am creating my first Wordpress theme and I am struggling with menu support: I added a custom menu in functions.php and implemented it into my header.php like shown below but the menu-option in the administration area does not show up! # functions.php <?php add_theme_support( 'menus' ); add_action( 'init', 'register_my_menus' ); function register_my_menus() { register_nav_menus( array( 'primary-menu' => __( 'Primary Menu' ), 'secondary-menu' => __( 'Secondary Menu' ) ) ); } ?> # header.php #

wordpress , problems with text blocks, they dissapear

南笙酒味 提交于 2019-12-11 03:53:45
问题 I'm a beginner in wordpress,recently I installed the dokan plugin for my online shop, gave me problems and I read that the solution was add this code add_action('wp_enqueue_scripts', 'mgt_dequeue_stylesandscripts',99); function mgt_dequeue_stylesandscripts() { if ( class_exists( 'woocommerce' ) ) { wp_dequeue_style( 'select2' ); wp_deregister_style( 'select2' ); wp_dequeue_script( 'select2'); wp_deregister_script('select2'); } } I am using the handy store template, so I put the code in the

WordPress Child Theme including includes files

Deadly 提交于 2019-12-11 03:34:42
问题 I am working at a WordPress setup on my local computer using AMPPS as my localhost. Using the Delta Theme I created a Child Theme (delta2-child). The initial setup works great. However, I need to change a file in the includes folder called home-slider.php. location of original file: c:\Program Files (x86)\Ampps\www\armstrong\wp-content\themes\delta\includes\home-slider.php Location of Child Theme files: c:\Program Files (x86)\Ampps\www\armstrong\wp-content\themes\delta2-child\includes\home

Responsive site works on desktop but not mobile

早过忘川 提交于 2019-12-11 02:15:39
问题 I'm working on developing this responsive Wordpress site: http://www.allisoncassels.com/Test/ and having a problem with my media queries. I coded the CSS for the following breakpoints: /* Portrait Tablets */ @media only screen and (min-width: 768px) and (max-width: 959px) /* Portrait Mobiles */ @media only screen and (max-width: 767px) /* Landscape Mobiles */ @media only screen and (min-width: 480px) and (max-width: 767px) On desktop, everything looks great. On my phone and tablet, some

Wordpress - single.php called twice

浪尽此生 提交于 2019-12-11 01:58:15
问题 I am working on a plugin and for some quick and dirty development I have added a function call to single.php that calls a function in my plugin which stores data about the current post in the db. I have noticed, though, that it is always called twice: once for the post I am requesting and once for another post (which does not show up in the content of the page). Does anyone know why this is and, if so, whether it's desired behaviour and how I can fix it if not? Here's an example similar to my

“NetworkError: 404 Not Found” /style.ccs

拥有回忆 提交于 2019-12-11 01:57:52
问题 I'm getting an error in firebug: "NetworkError: 404 Not Found - (removed)/style.css" What does that mean and what do I need to do? Thanks! 回答1: HTTP 404 means exactly what it says -- File Not Found. Somewhere in your document, you are linking to (removed)/style.css, and that file doesn't exist (wrong name, wrong location) on the server. There is a line in your code probably like this: <link rel="stylesheet" type="text/css" href="(removed)/style.css"> pointing to it, and that needs to be

editting wp_nav_menu() so it prints DIVs instead of LIs

我们两清 提交于 2019-12-11 01:53:33
问题 I have a header navigation with kinda difficult hover effect. In order to make it dynamic and NOT hard-coded, I'm gonna have to use spans inside list elements or even better I'm gonna need entire navigation done using DIVs. Is there a way to edit the wordpress function wp_nav_menu() (codex definition) so that it will give me divs that I want instead of ul-li hierarchy? Another solution is to build it the common way but then append spans to it using jQuery. But that's my last resort. Has

wp_query to show pages that starts with some character

允我心安 提交于 2019-12-10 21:45:28
问题 have question about wp-query function in wordpress. My question is, is it possible to show just pages that starts with some char. For example I want show all pages that starts with char A and also that page is child of some parent page. I know how to show child page with some full name: $query = new WP_Query( 'pagename=contact_us/canada' ); Now I want something like: $query = new WP_Query( 'pagename=contact_us/c%' ); So all pages that name begins with c ? I try this with with SQL logic and