FAQ Database Discussion Community


Foundation and Wordpress blank spaces

wordpress,zurb-foundation
Anyone has an idea about the blank spaces that I'm getting in a while loop with wordpress using foundation framework? <div class="large-8 columns"> <?php query_posts(array('category_name' => 'revista', 'paged' => get_query_var('paged'), 'posts_per_page' => 9 )); ?> <?php while ( have_posts() ) : the_post(); ?> <article class="boletin large-4 columns" style="min-height:1px;"> <a href="<?php...

$wpdb returns duplicate posts

php,wordpress,wpdb
I have created a shortcode which shows the posts which were created after the user last logged in. The shortcode is working perfectly fine, but I am not sure why but I am getting 7 duplicate posts. So like for test I created a post named as "Sample Article", and...

Custom Loop Pagination in Wordpress

wordpress,pagination,custom-post-type
im using this custom loop within a wordpress page. It works great (although it has been simplified here). However, it displays 100's of search results on one page. Because it is a custom loop, i am struggling to get it to work with some pagination (ideally 10 per page). Has...

Wordpress function to effect only one (custom) post type, and not every post

wordpress,custom-post-type
I'm having an issue with a custom post type (WP Job Manager). I am using the following code in my functions file to 'add a default image to posts that have no image attached'. function custom_default_cover_image( $image, $args ) { global $post; if ( $image ) { return $image; }...

wpdb - add up values for custom field within a specific category

php,wordpress,wpdb
I have a custom field called "points." This is a numerical value, so some posts have 2 points, some have 10, etc. I want to count the total number of "points" for all of the posts within a given category who also have the custom field "cf_Category" with the value...

Woocommerce Return False with message

php,wordpress,woocommerce
I am using a function to remove the ability to purchase a product if its price is equal to, or greater than £50,000. I would like to add a message where the add to cart button usually is, to say "this product is over £50,000 - please contact us" add_filter(...

WordPress show current page submenu

javascript,jquery,css,wordpress
I have tried to search for this, but I think I'm phrasing the question wrong. What I would like to do is have a submenu appear if a user is viewing that page. Kind of similar to a drop down menu, but instead of on a hover effect, I'd like...

Creating complex queries with WP_Query in Wordpress

wordpress,wp-query
Here's a complex query which we've built using WP_Query. It should: Ignore post id 191 AND Select all posts with 'reihenfolge' <= 18 AND Ignore posts without a featured image AND Order them randomly Here is the code: $args_projekte = array( 'post_type' => 'projekt', 'posts_per_page' => 18, 'meta_query' => array('relation'...

String indices must be integers, new to python

python,wordpress
I hope I won't get trashed for this question. This is my first day with Python and all I've done so far is copy pasting and deducing from other snippets of code. I have no experience with code. I'm trying my hardest however this one I can't get past for...

Passing variables from PHP to Javascript with wp_localize_script function

ajax,wordpress,wordpress-plugin
I´m trying to get my PHP variables into a JS file, in my wordpress plugin. Following the cake recipe, a code the below snippet. * PHP * $someone = 'whatever'; function admin_script_style( $hook ) { global $post_type; wp_register_script( 'my_scripts', plugins_url( '', __FILE__ ) .'/js/' . 'scripts.js', array( 'jquery' ), '1.0',...

Bxslider, Custom Fields & Wordpress

php,wordpress,bxslider
Good Afternoon, can anyone explain how i can achieve two things with the existing code below: Remove the null values, as these are exporting bxslider items that have broken links For some reason two versions of each image in the the pager are showing. Can anyone see why and how...

wp_schedule_event hook sheduled but not working

php,wordpress,cron,wordpress-plugin,cron-task
I'm trying to trigger cron job from WordPress Plugin that I'm writing (It's gonna take all new Products and export them to CSV every day) so the problem is that when I'm put this code in functions.php all working great and the code is valid but from the plugin folder...

Wordpress page can't continue due to this error

php,css,wordpress,wordpress-plugin,wordpress-theming
I just faced this problem recently, I don't what causes it . But I need help fixing it. The error are : http://www.udesign.my/aaf4/wp-admin/admin-ajax.php?action=woocommerce_checkout Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://fonts.googleapis.com/css?family=century+gothic+:300,400 Failed to load resource: the server responded with a status of...

Wordpress - loadin admin.css at last

css,wordpress
This is my code to load a CSS file in the wordpress backend: function customAdminStyles() { $url = get_bloginfo('template_url') . '/wp-admin.css'; echo '<!-- custom admin css --> <link rel="stylesheet" type="text/css" href="' . $url . '" /> <!-- /end custom adming css -->'; } add_action('admin_head', 'customAdminStyles'); The problem is that the...

Can not link the author

wordpress
I am Making a blog site. I want to show all posts of a user by linking with his/her user name. But it's not working. My code is by <a href="<?php get_author_posts_url(get_the_author_meta('ID'));?>"><?php the_author();?></a> What's wrong with it actually?...

need wordpress plugin to show 3 type of different kind of text, image and 2 buttons

wordpress,plugins,wordpress-plugin
I have slider image on http://techturners.com/arman-badwal/ page in "featured work" section. I need plugin to create dynamic slider like image in section.I use many sliders like cyclone-slider but they show only title, description and image.

CSS mystery: why the extra height in my div's?

javascript,css,wordpress
I'm just starting in on a new site and am getting extra space at the top of the div's I'm building for the home page. Using Safari's Web Inspector, I've eliminated any obvious padding or margins being responsible; but it's also seemingly telling me that the height of the div's...

Excluding certain pages from being redirected to https

wordpress,.htaccess,redirect,https,http-redirect
I'm using the following rules on my WordPress website to: Redirect all http pages to https Redirect the careers page to http <IfModule mod_rewrite.c> RewriteEngine On # Go to https if not on careers RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} !^/careers$ [NC] RewriteRule ^(.*)$ https://www.mywebsite.com/$1 [R,L] # Go to http if...

Query based on custom field

wordpress,wordpress-theming,advanced-custom-fields,wpdb
I have made custom fields using advanced custom field plugin. It has a field name school which includes choices such as arts,education,engineering. Now my problem is how can i query only those post who field is arts using wpdb. sincerely i don't know wpdb works. . Any help will be...

Add second single product page in Woocommerce

wordpress,woocommerce
Is it possible to add a second single product page in Woocommerce? So basically when I am at the single product page I click the "next" button and I get directed to the same single product page with another template. So I just want to retrieve the same data on...

How to run PHP through Adobe Muse generated CSS

php,html,css,wordpress,muse
Thanks for having a look at my question and I hope you can help. Yes there are some similar questions that have already been answered but this is different! What I am trying to do I am building a site that pulls posts from wordpress and displays them in a...

Can't select the current database name

php,mysql,sql,database,wordpress
I need to write a code that finds the name of the current sql database and puts that name in a variable. I'll take any suggestions, but what I was thinking was querying the current database name and putting that in a variable. I don't know if that will work...

Changing font-size of
  • on wordpress
  • css,wordpress,html-lists
    I am adding some pages on a wordpress themed website. There is a table with 3 columns: 1st column will be the title (larger font). Since it looks better and editing is easier, I started using <ul> instead of <td> Even though it works fine on JSFIDDLE font-size on the...

    Contact Form 7 SMS integration with twilio

    wordpress,sms,contact-form-7
    How do I setup so that I can send out SMS whenever someone has fill in the form? I'm using https://www.twilio.com for the sms. Where do I include the actions in contact form 7 when submitting form? Appreciate any help here, thanks!

    What does the $wp_did_header do in wordpress?

    php,wordpress
    What does the $wp_did_header variable do in wordpress in wp-blog-header.php file? And why is it setted to true?

    How to remove the quantity field from cart page for specific product attribute WooCommerce

    php,wordpress,woocommerce
    I need to hide the "quantity" field for specific product in cart.php Here Is my cart.php . WHere the attribute is Color the quantity field should hide. I have try $attributes = $product->get_attributes(); but I failed or I was missing something . I have share the cart Image and my...

    woocommerce thumbnails have different image widths in chrome and mozilla

    html,css,wordpress,google-chrome,mozilla
    Hello I recently run into a weird issue. I am running a Woocommerce theme built on bootstrap 3. I did some custom CSS modification and Image thumbnails appear REALLY narrow on Chrome and fine on Thunderbird. Could someone help me? I might be missing something fundamental here... Before you ask,...

    Slider misbehaving

    css,wordpress,wordpress-plugin-dev
    I've implemented a slider plugin into my theme and unfortunately, some misbevahiour occurs when is activated using the golden info+ button. The highlighted elements, is acting unusual: -the left sidebar text and the lower right arrow, is changing its position going up or disappearing (depending on slider); -the header logotext...

    Strange error when developing a Wordpress theme

    php,html,css,wordpress
    I tried to follow this video tutorial (on YouTube). However I receive this extremely strange error which I can't understand. I've included an image to show the error: I've checked my code 100 times and have compared it with the tutorial code, and I think the error is in index.php....

    Wordpress plugin ajax returns 0

    javascript,php,jquery,ajax,wordpress
    I'm trying to send AJAX data to my wordpress table but all I can get from my PHP is a 0. Its on the admin side. Can anyone help me? Also all of this code is inside my plugin-admin.php file inside my plugin folder. <?php if ( ! defined( 'ABSPATH'...

    Hacked WP, regex link removal

    regex,wordpress
    I am working on a Wordpress website which got hacked by a "Pharmahack". I have done multiple scans and checked multiple files they all seem fine. My task now is to remove all of the spam links and text, at the moment I'm doing it manually from a DB dump...

    jQuery click event search bar

    javascript,jquery,wordpress
    I have a jQuery issue I need help with. On my WordPress site I'm using a jQuery script for search bar. Currently there is a button and on click it shows up a search bar. I want that search bar to be visible by default (always). So I wouldn't have...

    How can merge two arrays values in one array and save in database

    php,arrays,wordpress,meta-key
    I am working on WordPress upload meta fields. When user upload images the images are sized in two dimension one is "thumb" and one is "big" and they re sized very perfectly. I save both of images dimension path in database with different meta keys Like: for thumb image wpc_resize_thumb_images...

    Wordpress End If Statements

    php,wordpress,woocommerce
    Apologies, PHP is not my strongest area so this might seem super easy to others. I am trying to implement a statement to say, when there is something in my WooCommerce Cart to show the cart. If there's nothing in the cart then show nothing. The code I have so...

    How to exclude posts without featured images from custom post type WP_Query

    wordpress,wp-query
    We have the following WP_Query which collects all custom posts (except id=191) and lists them randomly: $args_projekte = array( 'post_type' => 'projekt', 'posts_per_page' => 18, 'post__not_in' => array(191), 'orderby' => 'rand', ); $query_projekte = new WP_Query($args_projekte); How do we extend this to ALSO exclude all posts WITHOUT featured images? Thanks...

    getElementById with an array Javascript

    javascript,jquery,arrays,wordpress
    I'm modifying a plugin of wordpress and I have a little problem. When I search in an array an id, the console returns me that form[0].getElementById is not a function. That's my code. var form = document.getElementsByClassName("modal-body"); var i=0; while (i<(form.length)) { var tag = form[i].getElementById("em-booking"); if(tag) { var carles...

    woocommerce - make order notes required

    wordpress,woocommerce
    is it posible to make woo 'order_comments' field required - and show message If the field is not filled I have tried the following code but I can not get it to work. add_action('woocommerce_checkout_process', 'my_custom_checkout_field_process'); function my_custom_checkout_field_process() { // Check if set, if its not set add an error. if...

    Redirect 301 with wordpress articles from a domain to another

    wordpress,.htaccess,redirect
    my client changed his wordpress website to a new domain. I tried with the htaccess to redirect 301 the articles dynamicaly but it's not working. The URL format of articles are : /%year%/%monthnum%/%day%/%postname%/ I put this in htaccess but not working : redirect 301 /([0-9]*)/([0-9]*)/([0-9]*)/(.*)/ http://www.newdomain.com/$1/$2/$3/$4/ Can you help me...

    Gravity Forms - Show link after submission

    javascript,jquery,wordpress,forms
    I have a link set with display: none with the URL of a file that my users can download after correct submission of a Gravity Form. The things is I only want to show this link if submission was successfull. The only event I have found so far is gform_post_render,...

    How To check Product Have Variation in woocommerce

    php,wordpress,woocommerce,product
    Is there any way to check the product has variation something like Please help me. <?php If (product has variation) { echo"This Product have Variations "; } else { echo "This Product does not have Variations "; } ?> ...

    Conditional text for certain categories within taxonomy.php

    wordpress,conditional,archive,taxonomy,easy-digital-downloads
    I am building a Wordpress site using 'Easy Digital Downloads'. The downloads have their own 'categories'. To display an archive of those categories (different from the standard archive.php) I am using a template called taxonomy-download_category.php as specified in their documentation. This works perfectly and I can set up the category...

    BeautifulSoup: Parsing bad Wordpress HTML

    python,html,regex,wordpress,beautifulsoup
    So I need to scrape some a site using Python but the problem is that the markup is random, unstructured, and proving hard to work with. For example <p style='font-size: 24px;'> <strong>Title A</strong> </p> <p> <strong> First Subtitle of Title A </strong> "Text for first subtitle" </p> Then it will...

    Wordpress Custom Post Type categroies

    wordpress,custom-post-type,advanced-custom-fields
    I have a custom post type called STORIES. When a user adds a new STORY, I need them to be able to assign a category (or multiple categories) to the post so I can sort them later by category. To do this, I only want specific categories I assign to...

    Text-decoration/CSS causing text to move

    html,css,wordpress
    I've tried a bunch of techniques to solve this. I've used float (left/right) and played with positioning (absolute & relative). None worked. Basically my navigation keeps moving when the the text decoration (font-weight: bold; in this case) is applied. I'm new to CSS and this is my first header- so...

    WooCommerce seems to only orderby date and not price

    php,ajax,wordpress,woocommerce
    I am loading in variable products via a custom WP_Query $args = array( 'post_type' => 'product', 'posts_per_page' => 100, 'product_cat' => 'beast-balls', 'orderby' => 'date', 'order' => 'desc' ); $loop = new WP_Query( $args ); if ( $loop->have_posts() ) { while ( $loop->have_posts() ) : $loop->the_post(); ?> <div class="product-node cat-beast-balls">...

    Change the Path of wordpress featured image

    wordpress
    I am trying to change the current path obtained bywp_get_attachment_url(get_post_thumbnail_id) Now I get the uri as http://localhost/velocity/wordpress/wp-content/themes/velocity/images/pic01.jpg. but I want to change the uri as http://newhost/velocity/wordpress/wp-content/themes/velocity/images/pic01.jpg any idea?...

    Wordpress links don't work

    php,wordpress
    I'm a newbie in Wordpress and have just started to use it and I have a problem. I changed permalinks settings and in admin panel links of pages changed too but when I click on link in menu http://mysite/services/, I get 404 error instead of page. What's wrong? Do I...

    Wordpress on IIS with shared wp-content

    php,wordpress,iis,permissions
    I've been trying to install Wordpress on IIS and everything went smoothly with a standard installation and an handler mapping for php-cgi. Since I have a public server (A) and a private shared server (B), I need to have a WP installation on server A with a shared database and...

    Nivo Slider custom height/width problems

    html,css,wordpress,wordpress-plugin,nivo-slider
    I have searched for a resolution to my problem, but have not yet been successful. I have images of different sizes in Nivo Slider, but I need to create a viewport that displays the image centered in a div. It's hard to explain, but I have included a diagram below....

    .htaccess - 301 redirect where the URL structures aren't identical

    regex,wordpress,.htaccess,mod-rewrite,redirect
    I've been looking around for the answer to this but haven't been able to solve it myself. What I'm trying to do is redirect a group of around 1500+ URLs from one format to another, where the only thing that's consistent between the two is a string of numbers at...

    How to crop image from center using wp_image_editor

    wordpress,image,wordpress-plugin,resize-crop,wp-image-editor
    I am working on WordPress plugin. In plugin the user upload images from meta field and in back end i use wp_image_editor for cropping and re sizing the images. The images re sized very well but on cropping the images not cropped very well. I give x-dimension 100 and y-dimension...

    How can I change link in my dropdown menu [closed]

    php,wordpress
    How can I change links in my dropdown menu in worpress. Menu looks like this ITEM 1 || ITEM 2 || ITEM 3 || ITEM 4 || ITEM 2.1|| || ITEM 4.1|| || ITEM 2.2|| || ITEM 4.1|| || ITEM 2.3|| || ITEM 4.1|| I want that when the user...

    Basic trouble with PHP - Line shift

    php,css,wordpress
    I am working on a wordpress site and I am not very familiar with PHP. Somehow I have managed to produce the following empty line below the image: http://i.imgur.com/PazQgLl.jpg So my question is how I can remove or avoid having this empty space below the image. Here is the PHP...

    How to add sidebar at single.php in Wordpress

    wordpress
    I'm having a problem when it comes to adding sidebar at single.php. I already included <?php get_sidebar(); ?> But it seems to be appear below and the content(Blog post) still at the middle of the whole page. I've tried to check all of the previous forum but none of them...

    Wordpress log out using URL and redirect to specify page

    javascript,php,wordpress
    I have one Wordpress installation . i need to log out the user without any indication user is coming from particular URL.Is it possible? My code: <?php if($_GET['logout'] == 1) { $redirect_to = current_page_url(); ?> <script> window.location.href="<?php echo wp_logout_url( $redirect_to ); ?>"; </script> <?php } ?> I am using above...

    How to call posts from PHP

    php,wordpress,caching,cron,call
    I have a website, that uses WP Super Cache plugin. I need to recycle cache once a day and then I need to call 5 posts (URL adresses) so WP Super Cache put these posts into cache again (caching is quite time consuming so I'd like to have it precached...

    How to use curl return value in php script

    php,wordpress,curl,login
    I have two servers: A where WP is installed on one, and B where it's not. Application run on B is trying to use WP credentials for login. I have a login form on server B: <h1>Login</h1> <div> <form class="forma" id="form" action="login.php" method="POST"> <div class="form-group"> <label>Username</label> <input class="form-control" type="text" name="username"...

    Hide 'show more' button using AJAX

    javascript,php,jquery,ajax,wordpress
    I have button "Show more" on my WP site. By default 2 posts are shown, and on click on this button appears other 2 posts. So I need to check on page load, if there is more than 2 posts. It there is not, button hides. I use AJAX for...

    Random opening tabs/pills - bootstrap 3

    javascript,css,wordpress,twitter-bootstrap-3
    i want to open on every new site load another random tab with content. i think i have to do it with some java script but it don´t work. You can look at the page here: LINK Thanks for helping....

    Wordpress thumbnail grid expanding preview

    javascript,jquery,wordpress
    I found this great tutorial here: codrops Demo but I can't figure out how to get it to work in Wordpress! I'm a beginner/intermediate with Javascript, but I'm really not sure how to plug it into Wordpress. The Wordpress Codex mentions putting the script directly into the post since it...

    How to enable mod_rewrite on Apache 2.4?

    php,wordpress,apache,mod-rewrite,centos7
    I'm using Wordpress and wanted to enable pretty urls feature, but they don't work, i'm thinking that it's because of mod_rewrite, but i don't know how to enable it on Apache 2.4 under CentOS 7... I've already try this: grep -i LoadModule /etc/httpd/conf/httpd.conf | grep rewrite but nothing... Also would...

    WP_UnitTestCase - how to configure the include_path correctly with phpunit PHAR

    wordpress,phpunit,composer-php
    I'm trying to write a php unit test for my wordpress plugin and have been following the writing-wordpress-plugin-unit-tests tutorial. I've cloned the 'core.trac.wordpress.org/browser/tests/trunk/includes' locally I have installed phpunit via the PHAR mechanism as described here : https://phpunit.de/manual/current/en/installation.html#installation.requirements. I also have a composer.json configuration [14:11:04@~]$ phpunit --version PHPUnit 4.7.3 by Sebastian...

    How to seperate wordpress header navigation into side to side by edition Php files?

    php,css,wordpress,header,navigation
    I want to separate my WordPress menu navigation into both left and right, i have put the menu function into "functions.php" which added the menu from the backend, and frontend will be edited by the "header.php", but i couldn't retrieve the result, can anyone help me ? my function.php: register_nav_menus(...

    PHP $wpdb Select?

    php,mysql,wordpress,select
    I could use some assistance with an sql query. I have a small 3 column table, id, ip, and birthday. id auto increments. I'm trying to select all birthdays that are associated with a specific ip, but I'm not sure if the SQL statement I wrote is correct. The var_dump...

    Coding after Wordpress loop not showing

    php,wordpress
    I have been working on a custom archive page but I have run into some trouble. The pagination is shifting down into the footer area. I have gone through my code several times and I cannot work out why this is happening. If I remove the loop, the template works...

    Custom wordpress function not showing the right number of posts

    php,wordpress
    I have a custom wordpress function that shows the number of featured recipes. The function works fine when showposts=-1 is in the query. However when I put 'showposts=5' only two of my posts are shown. Below is my function function pika_featured_recipes_shortcode() { ob_start(); echo '<div class="featured-box-heading"> Featured Recipes </div>'; echo...

    How to use prepare() with dynamic column names?

    php,sql,wordpress,prepared-statement
    I have a function that takes an sql table column name string as a parameter, returns 1 string result: function myFunction($column_name) { return $wpdb->get_var($wpdb->prepare("SELECT %s FROM myTable WHERE user_id=%s", $column_name, $current_user->user_login)); } However, this code does NOT work, since with the nature of prepare, I can't use a variable for...

    Run AJAX function on form submit button after javascript confirm() cancel

    javascript,jquery,ajax,wordpress,forms
    I have a form where and AJAX function runs on form submission to make sure that the data in the form doesn't conflict with data in the database. If a conflict is found, the AJAX function pops up a confirm() box. If the user clicks "OK", the form is submitted....

    Trying to fill a SVG map from wordpress custom categories

    wordpress,dictionary,svg
    I've created a custom post_type (destinations) with a category (locations) to provide a tree structure for my SVG map: Continent/Country/Town Example locations: Europe/Germany/Berlin/POST Europe/Italiy/Sicily/POST North-Africa/Morocco/Marrakech/POST My plan was to fill the map by the country short codes like (DE for Germany, IT for Italia, LY for Libya (...). Here is...

    Wordpress list category in custom post type

    php,wordpress,custom-post-type,categories
    I have a query below which I want to list ONLY those categories assigned to the current post I am viewing. At the moment, it lists ALL of the categories for my custom post type. Is it possible to list just those for the individual post? The post type is...

    Remove frameborder in avada theme in youtube shortcode?

    wordpress,themes,shortcode
    i have using following shortcode. [youtube id="" width="" height="" autoplay="" api_params="" class=""] When i add this shortcode frameborder comes in iframe. i need to remove frameborder can anybody help me...

    Redirect based on operating system

    javascript,wordpress,redirect,user-agent
    I'm new here and I apologize if this question is basic/stupid. I am not too familiar with coding, so please excuse my ignorance/glaring errors. I have tried to put this together using code snippets found online and luckily I don't have to code too much for this project. I am...

    How to remove lines of code in a Wordpress child theme?

    php,wordpress
    I've been messing around with child themes in Wordpress and while I know how to add or change code from the parent theme I'm having a bit of a problem removing certain code. For example I'm using a theme that uses featured images for thumbnails in posts. I want the...

    Woocommece login URL

    wordpress,woocommerce
    I have a custom page for login in Wordpress with Woocommerce integrated, and need that when a user click on my-account page, instead of using the login form from woocommerce, redirect to my custom login url. my-account page only must be seen in case the user is logged in,else, I...

    login with username or email in wordpress

    wordpress
    I am working on login template...but I want to make login with username as well as email.I got code with for that but it is not worked,it is as follow: function login_with_email_address($username) { $user = get_user_by('email',$username); if(!empty($user->user_login)) $username = $user->user_login; return $username; } add_action('wp_authenticate','login_with_email_address',10,1); I already put action in 'authenticate'...

    How can I add a field only if it is completed?

    php,html,wordpress
    I have a site: link In this page you will find a link that says "website", this link is complete administration panel. The problem is that not all companies have websites, and then the field must remain free. If the administration panel, the field remains empty ... the site use...

    WooCommerce: How to display Category Name in single-product.php

    php,wordpress,woocommerce
    How can I display the category name in single-product.php? In archive-product.php the code is: <?php woocommerce_page_title(); ?> but what could I use to show the category name in the single-product.php that belong to the category?...

    How to fetch the page id and use it for an image name

    php,wordpress
    I am new in php. I want to make a condition for showing page id and set my image name is pageId and show this background image in my header banner. How to fetch page id use it fetching image for my banner background img. Here is my code: <div...

    Find and print the host name of the mysql in wordpress

    php,mysql,wordpress,hostname
    I am trying to find the hostname of the sql using wordpress. ie I wanted to print the 'localhost' from 'http://**localhost**/velocity/wordpress/?page_id=4' I tried the function home_get_url(), but I got the entire path as shown above. When I was trying with gethostname() I got my PC name. ' Please help. I...

    Store posts data according to timestamps in array

    php,arrays,wordpress
    I have been trying to create a structural format of posts with the help of Wordpress get_posts function. The structure with I am creating is based on the post timestamps. So basically the posts having the same timestamps will be collected together and displayed on the page. The structure is...

    How to display grouped products in a list with quantity in woocommerce?

    wordpress,woocommerce
    I want to change the way grouped products are shown by two different versions of wordpress. case 1: Wordpress 4.1.5 running WooCommerce 2.3.11 with custom theme. case 2: Wordpress 4.2.2 running WooCommerce 2.3.11 with default theme. I need to display grouped products (child products) in a tabular form with quantity...

    Wordpress Custom Post type archive display

    wordpress,templates,custom-post-type,advanced-custom-fields
    I have a custom post type named STORIES. Within that post type, I have categories, so each STORY is also assigned a category like this... Story 1 (assigned category RED) Story 2 (assigned category BLUE) Story 3 (assigned category GREEN) etc. I need to display a page which lists the...

    CSS disable horizontaly scrolling - Wordpress [on hold]

    php,html,css,wordpress,responsive-design
    Hi im working on a wordpress blog and have the following problem: http://www.catlovers.co/17-cat-reactions-that-sum-up-your-love-life/ If i resize the browser (X-Axies) to a minimum like surfing on a mobile device i am able to scroll to the right in the Contend section (hold down middle mouse button). How can i change my...

    WordPress expanding grid with thumbnail

    javascript,css,wordpress,grid,expand
    I'm using codrops solution to display team members in an expanding grid: http://tympanus.net/codrops/2013/03/19/thumbnail-grid-with-expanding-preview/ I was already able to change some code to display my post thumbnail in the grid preview. However, I want to display the same picture in full size in the expanded view. In the original version it...

    First getElementsByTagName() returns all elements in HTML (Strange behaviour)

    php,wordpress,dom
    I am using PHP to parse HTML provided to me by Wordpress. This is a post's PHP returned my Wordpress: <p>Test</p> <p> <img class="alignnone size-thumbnail wp-image-39" src="img.png"/> </p> <p>Ok.</p> This is my parsing function (with debugging left in): function get_parsed_blog_post() { $html = ob_wp_content(false); print_r(htmlspecialchars($html)); echo '<hr/><hr/><hr/>'; $parse = new...

    How to hide the help button from the dashboard of wordpress?

    css,wordpress
    I am new in wordpress and i want to hide the help button that is located on the top right of the dashboard in admin backend of wordpress. I don't want to use any plugin or remove its code. I just want to include css display:none to the css file...

    Empty email data when I send an AJAX contact form from Wordpress

    php,jquery,ajax,wordpress
    I'm a noob with AJAX and PHP development. I have made this HTML contact form in Wordpress custom theme: <div class="footer-form"> <form class="footer-form-contact" name="contact"> <h3 class="anuncio" id="formulario-contacto">Contacta con nosotros</h3> <input type="text" placeholder="Nombre" name="nombre" id="nombre" required/> <input type="email" name="email" id="email" placeholder="Email"/> <input type="text" placeholder="Teléfono" name="telefono" id="telefono" required/> <textarea...

    Two language site in wordpress what i can do [on hold]

    wordpress
    I want to create 2 language site in word press. I am pretty new in word press. so what can i do. I will have 2 different theme for each language or do something else. The English is for left to right while Arabic is for right to left. So...

    Wordpress - customized pages with blocks - prohibit google seo index of blocks

    wordpress,seo,woocommerce,robots.txt,google-sitemap
    I'm using Wordpress and WooCommerce for my online shop. With the theme I'm using you can customize the product-category pages by adding "blocks". So if I want to have a text on the top of a product category page I simply create a block page, lets say its called "category-info"....

    How can I set the Image of woocommerce category as the background of the category title? [duplicate]

    php,html,wordpress,woocommerce
    This question already has an answer here: How to display Woocommerce Category image? 3 answers I want to set the woocommerce category image as the title background. This is the title line in archive-product.php <h1 class="page-title"><?php woocommerce_page_title(); ?></h1> I wrote <h1 style="background: url(<?php if ( is_product_category() ){ global $wp_query;...

    Changing DOMNode tag name creating anomalies within the saved HTML

    php,wordpress,dom
    In the process of making a Wordpress post parser for my personal website but hitting some behaviour I can't explain. Here's the code: // Wordpress uses <p></p> sections for new lines $sections = $doc->getElementsByTagName('p'); foreach ($sections as $section) { $hasChilderen = $section->hasChildNodes(); $contents = $section->nodeValue; // If we have text,...

    How to Extract Part of a String In JavaScript

    javascript,jquery,string,wordpress
    I am using a chunk of jQuery code that returns a selected option from a group of image icons. It is integrated into the WordPress WYSIWYG Editor. When I click on the icon this string is sent to the editor: image="'+ $('.icon-option i.selected').attr('class') +'" This code returns: fa fa-heart selected...

    If image is null from JSON, use another image - AngularJS

    json,angularjs,wordpress,angularjs-ng-repeat,wp-api
    Below I have an ng-repeat where the inner div gets a background image set after reading a JSON file. My question is - If post.featured_image.attachment_meta.sizes.medium.url does not exist or is null, what would be the best approach to replace this with another image? Say a default backup image? A solution...

    Display wordpress posts in ascending order

    php,wordpress,templates
    I am trying to display wordpress posts in ascending instead of descending order. The code I am using in my template is below <?php $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $wp_query->query('showposts=24&post_type=movie&orderby=ASC' . '&paged=' . $paged); while ($wp_query->have_posts()) : $wp_query->the_post(); ?> however this is not working. Does...

    How do I check if items in a array are present in a string php

    php,arrays,wordpress
    I have an array of items, how do I scan a string and detect if the items in the array exist anywhere in the string. I seen other post that are similar to this question but none have worked. Maybe it is because I'm using wordpress ex: $string = get_the_title();//...

    Reactivating WordPress Jetpack plugin throws an error

    wordpress,jetpack
    I am getting the following error when trying to re-activate Jetpack plugin: Invalid request, please go back and try again. Error Code:invalid_client Error Message: Unknown client_id. ...

    ACF Multiple Map Markers

    wordpress,google-maps,google-maps-api-3,acf
    I'm using Advanced Custom Fields and want to pull in the field called 'location' to display some locations on a map. How would i adjust the following code to display multiple markers from my location field? The format of the custom field is like so: echo 'Location: ' . get_field('location');...

    How to add stripslashes to get_option()

    regex,wordpress,wordpress-theming,sublimetext,stripslashes
    Hy, I created a WordPress Theme using a lot of custom options. While saving the options in the backend amongst other things I'm adding backslashes before characters that need to be escaped. Such as ' and ". Now I need to remove them before displaying them on the frontend. The...

    Wordpress and Xampp not open child pages

    php,wordpress,xampp
    I'm working with wordpress + xampp but I can not see the child pages. Appears: Object not found! The requested URL was not found on this server. The link on that page seems to be in an error or out of date. Please inform the author of that page about...

    Display Popup when text is clicked in wordpress

    wordpress,text,popup,wordpress-plugin
    I have a Html code In wordpress.: '<a href="">example</a>' When this "example" is clicked, it needs to show a popup window with some texts. i came across some wordpress popup plugins like uji popup,etc.. they given some short codes. how can i use this shortcodes into my "href". or any...