w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
In Wordpress, Getting The Site URL Inside a Stylesheet
Have you tried removing the slash in front <style> @media (max-width: 420px){ .home-background { background-image: url('images/home_page/bg-mobile.jpg'); } } </style>

Categories : Javascript

Load a different stylesheet in WordPress if an admin is logged in
I never used WP but if you can edit the code you could do a simple query if the admin is logged in and then use some inline-code <div class="example" <?php if($admin == 1){ echo 'style="display: block;"';} else{ echo 'style="display: none;"'; ?>> CONTENT </div>

Categories : PHP

Add a CSS stylesheet to Wordpress RSS feeds in an upgrade friendly manner
CSS isn't supported in most RSS feed readers, so even if you added code to use one, unfortunately the answer is that you can't from a practical perspective. Not really Wordpress specific - see: How can I apply my CSS stylesheet to an RSS feed.

Categories : CSS

Adding stylesheet from plugins folder to front end, inside of plugin
try removing array from wp_enqeue_script function input_admin_enqueue_scripts() { // register scripts wp_register_script('input-icon_field', $this->settings['dir'] . 'js/input.js', array('input'), $this->settings['version']); wp_register_style('input-icon_field', $this->settings['dir'] . 'css/input.css', array('input'), $this->settings['version']); // scripts wp_enqueue_script('input-icon_field'); // styles wp_enqueue_style('input-icon_field'); } and add an action to this function like so add_action('wp_enqueue_scripts', 'input_admin_enqueue_scripts');

Categories : PHP

Adding Namespace to Java (Apache FOP's - JSP) file parsing through a XSL stylesheet
Use the top level element of the stylesheet to define all the namespaces: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:altova="http://www.altova" xmlns:x="adobe:ns:meta/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> Then remove the inline namespaces: <x:xmpmeta> <rdf:RDF> References W3C DOM: Namespaces Algorithms

Categories : Java

should I put default declaration on the same stylesheet with the media queries stylesheet?
The problem is that your selectors are of equal specificity (@media rules don't have any specificity) - both rules are using one class selector (.box) and because you're loading .style.css after enhanced.css the former takes precedence. You need to increase the specificity of your @media rule if you want to include it before your regular .box rule - e.g. @media only screen and (min-width: 320px) and (max-width: 480px) { body .box { height: 300px; }

Categories : CSS

How to cancel initial stylesheet when a mobile stylesheet is loaded?
You cannot cancel a stylesheet per se, but you can negate the effects of the previous stylesheet by overriding its CSS rules. You can also use a third stylesheet or apply media query rules to make some CSS that only applies for non-mobile devices. Like: <link rel="stylesheet" type="text/css" href="index.css" /> <link rel="stylesheet" href="desktop.css" type="text/css" media='screen and (min-device-width: 481px)'/> <link rel="stylesheet" href="handheld.css" type="text/css" media='screen and (max-device-width: 480px)'/> Note that these approaches require support for CSS3 min/max media queries. If you need to support browsers that are not capable of doing that (IE6/IE7/IE8), use a polyfill like Respond (https://github.com/scottjehl/Respond).

Categories : HTML

Internal Stylesheet NOT overriding External stylesheet?
I see at least one issue. If you're interested in finding out what happened to this: <h1><a href="#">xx</a></h1> Here's your problem. In your external CSS: #header h1 a { display: block; width: 273px; height: 51px; background: url(images/cap-logo.png); text-indent: -9999px; } The use of the ID is the most specific version of h1 with an a inline child to a #header element, so this is what gets used. As you can probably tell, this is moving the header outside the visible area. There's a couple ways to bring this back on the screen. The easiest way is to change the <h1> to a span with an id: <span id="big-x"><a href="#">xx</a></span> And then it's relatively trival to do what you need with this element. Oth

Categories : CSS

inline stylesheet to cascading stylesheet
Looks like someone already answered this for you - see the first response, there's an online tool to extract inline css and distill it into classes. Tool to automate converting inline css to external css?

Categories : HTML

Adding a jQuery into wordpress
As you are working with the wordpress, You are not supposed to paste the javascript code on in the pages from admin directly. If you are using the twentyeleven theme, wp-content hemes wentyeleven you have to paste that code in the either content.php or content-single.php, Then you can get the expected output.

Categories : Jquery

Wordpress adding extra day
Your first loop is missing the = in <=: for( $i = 1; $i < 7; $i++ ) { should be for( $i = 1; $i <= 7; $i++ ) { Is that what you mean?

Categories : PHP

Adding Custom Cookie To Wordpress
Bumped into this one - I recommend against adding a new cookie, instead I would hijack (take advantage of) the current cookie and let WP manage it for you. Additionally the hooks available in WP allow very clean and tight code using WP features - try the snippet below - I put in comments and tried to be verbose : function custom_set_newuser_cookie() { // re: http://codex.wordpress.org/Function_Reference/get_currentuserinfo if(!isset($_COOKIE)){ // cookie should be set, make sure return false; } global $current_user; // gain scope get_currentuserinfo(); // get info on the user if (!$current_user->user_login){ // validate return false; } setcookie('sitename_newvisitor', $current_user->user_login, time()+1209600, COOKIEPATH, COOKIE_DOM

Categories : PHP

Adding featured image in wordpress.com via api
The media parameter in that API call is used only for uploading local image files, but you're calling it with an external URL. You should be using the media_urls parameter instead. Relevant bit from the documentation: media: An array of images to attach to the post. To upload media, the entire request should be multipart/form-data encoded. Multiple media items will be displayed in a gallery. Accepts images (image/gif, image/jpeg, image/png) only. Example: curl --form 'title=Image' --form 'media[]=@/path/to/file.jpg' ... media_urls: An array of URLs for images to attach to a post. Sideloads the media in for a post. Your code could change to: ... 'content' => http_build_query( array ( 'title' => $title, 'content' => $content, 'tags'

Categories : PHP

Adding numbers to comments in wordpress
Look at the twentytwelve theme. It uses an ordered list. <ol class="commentlist"> <?php wp_list_comments( array( 'callback' => 'twentytwelve_comment', 'style' => 'ol' ) ); ?> </ol><!-- .commentlist --> In the functions.php twentytwelve_comment function the comments are wrapped in a <li></li>. If your comments are on multiple pages or you want to style the numbers you could use a plugin like http://wordpress.org/plugins/gregs-threaded-comment-numbering/. Read here how to use it.

Categories : PHP

Adding url parameters in Wordpress search
Not an exact answer, but you might want to look into using $_GET variables given how you're structuring this. You'd want your permalink to look like this (notice the quotes are removed): ?s=search&filtersearch=1&province=Example&searchvalue=Another-Example To get the value of province, you'd use this in your PHP: $province = $_GET['province'] You should then be able to use that in a function to filter your search.

Categories : Wordpress

Adding 410 to page in .htaccess in Wordpress
you don't want the http://example.com part in the pattern, that's not part of the URI that's used for the pattern to match against You don't need the =410 in the flags The URI is already decoded by the time mod_rewrite rules get applied, so you don't want (I'm assuming) the URL encoded string. Try: RewriteRule ^ыBуги/ - [G,L] RewriteRule ^ÐÑакÑи/ - [G,L]

Categories : Wordpress

Adding Modernizr properly to Wordpress?
Your wp_enqueue_scripts code is correct and Modernizr appears to be loading fine on your site. You need to do a similar invocation for adding stylesheets. function childtheme_script_manager() { wp_register_script('new_service', get_stylesheet_directory_uri() . '/js/modernizr.custom.js', array('jquery'), false, false); wp_enqueue_script('new_service'); wp_register_style('my_style', get_template_directory_uri() . '/css/component.css', array(), false, 'screen'); wp_enqueue_style('my_style'); } Note, I've left the $deps array empty, if the css has dependencies, you may need to specify those names in the array.

Categories : Wordpress

Adding Jquery to WordPress Menu
You can use this function for menu in wordpress site. function home_top_menu() { var currentParent = ''; var pos = ''; jQuery("#.menu ul").css({display: "none"}); // Opera Fix jQuery(".menu li").hover(function(){ jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).show(268); },function(){ jQuery(this).find('ul:first').css({visibility: "hidden"}); }); jQuery(".menu .sub-menu").hover(function(){ currentParent = $(this).parent('li').attr('class'); pos = currentParent.indexOf('current-menu-parent',0); $(this).parent('li').addClass('current-menu-parent'); },function(){ if(pos == '-1') $(this).parent('li').removeClass('current-menu-parent'); }); jQuery('#accessMenu

Categories : Jquery

Adding a jQuery file to wordpress admin
you have to add admin_enqueue_scripts instead of wp_enqueue_scripts so it should be add_action( 'admin_enqueue_scripts', 'alert_delete'); wp_enqueue_scripts is for the front end. hope this helps

Categories : PHP

adding include into wordpress functions.php return
Not quite sure what you're asking, but if you want your include file adding to the post: function addstyling($content){ global $post; $share = file_get_contents(TEMPLATEPATH . '/includes/share.php'); return $share . $content . '<br><br>Sharethis'; }

Categories : PHP

Adding HTML/Images etc into WordPress Menu
considering the default wp nav menu is rather limited when it comes to design options, the only possibility in my opinion is implementing a custom menu walker. some good starting info on that topic can be found here: http://jamescollings.co.uk/blog/wordpress-custom-walker-output-section-of-menu/ using this approach you can still manage your menu structure with wordpress standard tools, but have a lot more freedom when it comes to layouting the output. another approach would be using some extended menu plugins like for example http://wpmegamenu.com/

Categories : Wordpress

Adding Wordpress site to Symfony2 (route)
So after a bit of searching I've finally got the answer. All that I needed to do was add the following to my Virtual Host: Alias /blog /home/john/development/phoenix/src/web/Wordpress <Directory /home/john/development/phoenix/src/web/Wordpress> Options All AllowOverride All order allow,deny allow from all </Directory> That way I could view my main website at www.example.com (which was hosted at /home/john/development/phoenix/src/web) as well as view the Wordpress part of the site at www.example.com/blog (which was hosted at /home/john/development/phoenix/src/web/Wordpress)

Categories : Symfony2

Adding an if/else PHP redirect to a page template in Wordpress
PHP redirects must be called before any HTML (or anything at all) is outputted. This means, you can't use them in the middle of the page as you see fit. That means you could have one space somewhere in a PHP file that would make it impossible for you to redirect, and it might be hard to find it. Alternatively, you can do a Javascript redirect at this point. From the PHP documentation (http://php.net/manual/en/function.header.php) : Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include, or require, functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists whe

Categories : PHP

WordPress adding get_posts results and re-ordering
at the simplest level, you cannot concatenate (use the dot operator as you would on strings) on arrays. try using array_merge $myposts = get_posts("category=$category->id"); $myposts = array_merge($myposts, get_posts("category=$category->id")); Although, I think what you are trying to achieve is a listing of posts from several categories correct? The above example will give possible duplicates (if same post is in multiple categories) try the more WP way of doing this: //array of categories $categories = array(); // I assume you are looping through something to get the multiple `$category->id` for($some_category_objs as $category) { $categories[] = $category->id; } // query for posts where the post has every category in the list $myposts = query_posts(array('category__

Categories : Wordpress

Adding custom rewrite rules to WordPress
After you update the WordPress rewrite rules, you need to flush them: http://codex.wordpress.org/Function_Reference/flush_rewrite_rules You can choose to flush with the $hard parameter true, and then you should be able to see your rewrite rules in the .htaccess file.

Categories : Wordpress

Adding dynamically to WordPress post
According to docs here this is how you do it: http://codex.wordpress.org/Next_and_Previous_Links <?php previous_post(); ?> <?php next_post(); ?>

Categories : PHP

Adding background image in css with get_option() in wordpress
May be there is a CSS background rule is being applied forcefully. You can try using inline style. Like. <div id="slide_1" style="background: url('<?php echo get_option("slide_1");?>') no-repeat;"> ..... </div> Another thing I have noticed that in css rule background-image: url('<?php echo get_option('slide_1'); ?>'); you are using single quotes in php and also in css. This is producing a conflict. Try using background-image: url('<?php echo get_option("slide_1"); ?>'); double quotes.

Categories : CSS

Adding body classes with Wordpress PHP function
You could just put: $classes[] = "loading"; before you return the array. This will be added as a body class when: <body <?php body_class(); ?>> is run. The full documentation on the body_class() function is here: http://codex.wordpress.org/Function_Reference/body_class

Categories : PHP

Adding wordpress post ID's to a persistant collection
The easiest way to do this is probably to set cookies. The fantastic jQuery.cookie plugin found here makes this a piece of cake - setting and retrieving cookies just takes one line of code: To set: $.cookie('cookiename', 'cookievalue'); To retrieve: var whatever = $.cookie('cookiename'); // assigns 'cookievalue' to var whatever You can also set them to expire after a set amount of time, etc (those are session cookies above). If you need to store arrays (e.g. of post IDs or meta values) the plugin also lets you store JSON objects as cookies. See the documentation on the page I linked for details.

Categories : PHP

Adding a custom font to the TinyMCE editor in Wordpress
You can load CSS. In TinyMCE settings: content_css : "css/custom_content.css", Than custom_content.css should contain @font-face like: /* load a font */ @font-face { font-family: 'Foo'; src: local('Foo'), url('path/to/Foo.woff') format('woff'); } h1 { font-family: 'Foo'; }

Categories : Wordpress

Adding post id inside a wordpress database query?
I am not sure if I understand you correctly, but here what I think First the_ID(); is used to displays the ID of the current post within the loop, it does not returns the value of the post id. To get the post id use: get_the_ID(). Second, if you are outside the loop, then neither simply the_ID() nor get_the_ID() is going to work, you have to provide the post id manually or by receiving it using GET or POST method.

Categories : PHP

Wordpress - Adding default value to dropdown that links to no page
By adding an <option> in the <select> and a slight change in the javascript onChange event by checking if the selected option value is not empty : <?php $mypostype = get_posts('post_type=rentals'); if($mypostype) : ?> <form action="" id="myform"> <label for="myselect">Rentals</label> <select id="myselect" name="select_post_type" onChange="((this.options[this.selectedIndex].value != '') ? document.location.href=this.options[this.selectedIndex].value : false);"> <option value="" selected="selected">Select Rentals</option> <?php foreach ( $mypostype as $mypost ) : ?> <option value="?rentals=<?php echo $mypost->post_name; ?>"><?php echo $mypost->post_title; ?></option>

Categories : Wordpress

Adding section to change favicon in back end of Wordpress
You could create an options page that holds an upload form, which leverages the WordPress' Filesystem API that handles the file part of it. You just need to specify a solid place where the icon file is uploaded, as you want to keep the favicon data inside template file head section the same everywhere. But remember to validate all uploads! Bad things happen when users are allowed to upload malformed data (either by accident or on purpose). WP Codex also has a page on creating custom options pages, where this upload form could be inserted.

Categories : Wordpress

Wordpress registered users adding content or products
you may try below plugins ... http://wordpress.org/plugins/another-wordpress-classifieds-plugin/ http://wordpress.org/plugins/classyfrieds/

Categories : Wordpress

Adding extra classes to archive pages on Wordpress
Your theme header should have something like <body <?php body_class(); ?>>. You can add to your functions.php, or, preferably, in a custom plugin the following filter to manipulate the classes being output: add_filter( 'body_class', 'b5f_modify_body_classes', 10, 2 ); function b5f_modify_body_classes( $classes, $class ) { // Modify the array $classes to your needs if( is_archive() ) { $classes[] = 'woocommerce'; $classes[] = 'woocommerce-page'; } return $classes; } You can check WordPress function get_body_class() to see how it can be built.

Categories : Wordpress

adding style image in cutom menu wordpress
If you can, I would avoid styling menu items this way. Having a separate li for a border/separator image defeats the purpose of the HTML/CSS relationship. Could you apply the line-img.png to the background of the li element? Are you using wp_nav_menu() for the menu? It should generate code similar to: <ul class="menu"> <li id="menu-item-1" class="menu-item">Menu Item</li> </ul> You could could style the above with something like: .menu-item { background: url(imgs/line-img.png) no-repeat right center; }

Categories : PHP

Adding path to image in jQuery code in Wordpress
Jason, I believe you're running into a somewhat classic challenge with WordPress and JavaScript assets. You need a PHP variable (or some sort of PHP processing) accessible to your JavaScript, and of course, JavaScript can't parse PHP! Some of the comments suggest inspecting paths (to simply get your directory as it's been generated) but I'm not a fan of that approach as it assumes your theme path will always be the same. (And this can change if you rename your theme folder, change themes, or simply change your folder structure). I will typically inject a "helper" script in the <head> of all my themes. It's a very simple JSON object that's name-spaced (to keep the global scope clean). <script> // for bootstrapping page level code var YOURSITENAME = { "isFrontPage":<

Categories : Jquery

Adding new user roll in WordPress that can only add custom posts
you could try this plugin, it should do everything you need http://wordpress.org/plugins/advanced-access-manager/

Categories : PHP

Page Not Found error after adding SSL to my wordpress website
I Think the problem is coming from a very simple place: Most web-servers today use a control panel and than it manges the traffic of the site (databases, requests and more). Now, with every domain registerd in your user at the CP you have public_html folder and a private_html folder. The public_html folder is the regular (default) folder you use and it points to http:// The private_html folder is the secure connection folder which is what you are looking for, and it is pointing to https:// So all you need to do is reinstall the wordpress in the private_html folder which is the pointer of https:// This should work for you :)

Categories : Wordpress

Wordpress $_SESSION not working even after adding add_action('init, '...',1)
See this answer for a discussion of using $_SESSION with WordPress. In short, WordPress removes session variables if register_globals is defined. The comments on the question itself point to this answer on the WordPress stackexchange, which discusses a plugin that may help you.

Categories : Wordpress



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.