Posts by brasofilo • 6,560 points
159 posts
-
3
votes1
answer6540
viewsQ: CSS animation of input and output element when scrolling on page
I’m making a div appear with input animation when the scroll hits a point on the page, the problem is that I can’t make the output animation when the scroll returns. The <div…
-
2
votes1
answer792
viewsA: How to customize og tags (Open Graph) on the post page - Wordpress
The recommendation in Guideline for Themes Development is to separate functionality from drawing. Things like SEO and Shortcodes do not belong in themes, because when changing Theme -which happens…
-
1
votes5
answers786
viewsA: Can I make a Javascript call through PHP?
In Wordpress, values are passed from PHP pro Javascript using "localization", which is to print on <head> of the document a PHP->JS object, and the scripts called after the location will…
-
2
votes1
answer577
viewsA: Close tooltip in Full Calendar
Like the #x-fechar does not yet exist in the DOM, have to declare his click() thus: $(document).on("click", "#x-fechar", function(e){ element.popover('hide'); }); But since it is more than one…
-
2
votes2
answers271
viewsA: Create a bottom bar with Tabs
Checking the source code it is possible to see how some page implements the design and functionality. In the case of the PHP Debug Bar website, it is a matter of pinning a menu to the footer and…
-
5
votes4
answers31096
viewsA: Writing and reading file via Javascript
We can create an object Xmlhttprequest to make an HTTP request to one Server-side language, who will be in charge of reading/writing the file. This example will be in PHP. With Javascript embedded…
-
1
votes1
answer1013
viewsA: How to add custom Fields in search for Wordpress backend?
The solution lies in this answer from Wordpress Developers: How to filter post Listing (in WP Dashboard posts Listing) using a custom field (search Functionality)? First, you need to add the…
-
6
votes7
answers762
viewsA: Randomize results with PHP
Instead of doing 9 shortcodes [meubanner_*] in Wordpress, this can be solved with one: [meubanner]. I adapted to solution of Mary to make the random number without repetition. And I made a plugin…
-
3
votes1
answer2279
viewsA: Form PHP validation in Contact Form 7
It is not exactly simple... It is necessary to create another plugin to take care of the validation. The first thing to do is to know which fields you want to filter: Let’s say it’s in the type…
-
1
votes1
answer9573
viewsA: How to display recent Wordpress posts on a page
There are two ways to do this. Page template Create a file within your theme, using as a base page.php and putting a name like recentes-page.php. Change the PHP header to: <?php /* Template Name:…
-
1
votes3
answers281
viewsA: How to remove a word created by a plugin from the site
Yeah, the plugin has not translation files (nome-pt_BR.po or .mo). I also searched inside Woocommerce and is not. It means that probably is in your theme (or another plugin). The most direct way is…
-
2
votes4
answers687
viewsA: include_once has no access to properties, variables or functions of the included file
It’s a scope problem. $tt has to be declared as global in the function generic inside funcaoGenerica.php. function generic($sting){ global $tt; include_once($sting); } I suspect there’s some more…
-
1
votes1
answer918
viewsA: Pulling content from a Wordpress feed using Javascript
I think much strange the way this code reads XML by placing it as the source of a script in the head of Markup HTML. var archivo = "http://example.com/feeds/posts/default?start-index=" +…
-
4
votes4
answers440
viewsA: Right menu in each Row of a table
Using the example from @Peoplee, I adapted to automate the process so: $('td.ativar').each(function(){ $(this).contextmenu({ menu: $(this).next().next().children('ul') // podemos usar jQuery aqui…
-
2
votes1
answer609
viewsA: Search returns only the home of the site
I don’t know why you’re wearing a page template when the default is that Theme has a filing cabinet search.php dedicated to display search results. Comparing your code with your Twenty Eleven I see…
-
1
votes2
answers4031
viewsA: How to change the /wp-admin/ Wordpress directory? and how to change the Wordpress admin Urls?
Very interesting the plugin recommended by @moraleida, has the face of must use. I’ve been analyzing the code and the interface, and I see there’s a limitation: it just hides the URL /wp-admin and…
-
0
votes3
answers405
viewsA: Pick up last Wordpress post on Cakephp
One can also use XML-RPC for consult Wordpress. Using a simple PHP file, we trigger a Curl request to the address http://example.com/wordpress-folder/xml-rpc.php calling some specific method. This…
-
3
votes2
answers466
viewsA: Edit categories and tags in the front end of Wordpress
The function you seek is wp_insert_term. Remarks: It is important to develop with the error report connected, you would see that $pid = $_REQUEST [ 'pid' ]; gives a Warning. Missing add a security…
-
4
votes2
answers807
viewsA: How to remove a Meta Tag created by a Wordpress plugin?
It is necessary to locate the hook responsible for printing this line in HTML. Usually, it is an action attached to wp_head. After that, we use remove_action or remove_filter to remove the hook. We…
-
2
votes1
answer159
viewsA: Trade ids by include in gallery shortcode in Wordpress
The following plugin is a gambiarra to exchange ids=" for include=" each time a post is saved. Take into account the following: You have to enable the search and switch option in all posts when the…
-
1
votes3
answers3421
viewsA: How to list all posts in a category in Wordpress?
The address to list all posts in a category is www.example.com/category/dicas, but it is not very recommended to remove the base /category/ of Urls. For example, a category wp-admin can block access…
-
3
votes1
answer169
viewsA: Display only comments made on author posts in Wordpress
Adapted of this response in the WPSE. As always, instead of putting the code on functions.php, we make a plugin to include this new functionality, since we do not want it to go away if we change the…
-
2
votes2
answers57
viewsA: How to edit or create new smileys in wordpress?
To modify or add code of smilies it is necessary to define the global $wpsmiliestrans before Wordpress. To modify or add images of smilies you need to add the filter smilies_src in accordance with…
-
4
votes2
answers1018
viewsA: How to drag elements using dragSort inside a scroll div?
It’s just add the parameter scrollContainer: $("#list1, #list2").dragsort({ scrollContainer: "#list1", dragSelector: "div", dragBetween: true, dragEnd: saveOrder, placeHolderTemplate: "<li…
-
2
votes3
answers3683
viewsA: Upload thumbnail only of Youtube videos
I made an example joining jQuery to replace the Youtube thumbnail with the iframe with the video on autoplay. The variable $yids is a collection of video Ids and from it pull up the thumbnails:…
-
5
votes1
answer894
viewsA: How to put Wordpress bilingual?
If qTranslate has not been updated yet, one can force its compatibility by changing the following value in the file plugins/qtranslate/qtranslate.php: define('QT_SUPPORTED_WP_VERSION', '3.8.1'); In…
-
5
votes1
answer5113
viewsA: How to add HTML dynamic code snippets with Javascript/jQuery
Following the tip from the bfavaretto, tested the implementation of mustache.js in a Wordpress theme and stays like this: 1) No functions.php we load the required Javascript files (jQuery,…
-
1
votes1
answer73
viewsA: Text extraction problem using Pdfreader API
The code you posted works on OS X. On package we see the following: My emphasis: Might work on Windows. And being the last update of 2010, I think it works on your system (C:\) it’s gonna be...…
-
2
votes2
answers1725
viewsA: Window Modal Frame Overlay
I thought something similar to the answer from Juninze: have a function within the frames (frame_modal()) that will simulate the Modal Overlay. The dialog() opens in frame1 and fires function…
-
0
votes2
answers413
viewsA: Loading Subdomain post in the main domain?
It’s just a matter of using the function switch_to_blog() and switch to the desired blog, make a query consultation of blog posts and use the same function to switch back to the original blog.…
-
1
votes3
answers621
viewsA: Service to resize uploaded images to a Wordpress site
A plugin is pretty easy: <?php /** * Plugin Name: (SOPT) Substituir Imagens Originais * Description: Substitui imagens originais (full size) pelo tamanho "grande" na hora do upload. Ajuda a…
-
7
votes2
answers538
viewsA: Concatenate array of selected checkboxes to use as a search filter
The function implode() was made for this: $separador = ' AND '; $array = array( 'nome', 'email', 'fone' ); $string = implode( $separador, $array ); var_dump( $string ); Results in: string(28) "name…
-
2
votes1
answer1273
viewsA: How to display a sequence of images from a single link?
I tested and that’s right, just make a set of images, but put content only in the link of the first. Using the example of Lightbox: <div class="image-set"> <a class="example-image-link"…
-
2
votes2
answers212
viewsA: Comment system with video
I have a plugin Wordpress that does something similar using the tags Open Graph inserted into many web pages today. Example of a video on Youtube: <meta property="og:site_name"…
-
1
votes1
answer70
views -
3
votes1
answer158
viewsA: Checkbox that pulls content from a custom post type
The way to do this is to add a custom Meta Box with add_meta_box() and within the box list your CPT posts using get_posts(). And the information will be recorded as a Custom Field using…
-
5
votes1
answer247
viewsA: jQuery Window plugin gives "$ is not defined" error
In the tests I did here using the code provided on the plugin page, it only works until jQuery 1.8.3. From 1.9.0 it stops working. Works: <body> <input type="button"…
-
2
votes2
answers4044
viewsA: Theme only on a Wordpress page. Is it possible?
The base code is very simple, adjust the page Slug and the theme name: <?php /** * Plugin Name: (SOPT) Theme for page */ add_filter( 'template', 'change_theme_wpse_12931' ); add_filter(…
-
2
votes1
answer377
viewsA: Image problem in Advanced Custom Fields plugin
What is returning is not an error. You have configured Field to return an "Image Object". So you are printing a complete object. Note that sometimes out of loop may not work if we do not put the ID:…
-
6
votes1
answer1123
viewsA: Why is this Bootstrap Tabs configuration not working?
Are missing the bootstrap.min.js and the jQuery. See Getting Started - Bootstrap. <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> <link…
-
1
votes1
answer68
viewsA: wp_schedule_event is not working
I managed to solve the following way, first the wp_schedule_event was like this: wp_schedule_event( $timeschedule, 'daily', 'my_daily_event'); Then I created an action like this: add_action(…
-
1
votes2
answers239
viewsA: Returning Value Inside Wordpress Post Type
To answer by Claudio Sanches is exactly what you need, but I’ll make a Code Review: It is not necessary to have two add_action( 'init', ... );, put it all together in one. You also don’t need to…
-
3
votes1
answer204
viewsA: Number of Seeds in a torrent
Apparently, the way is to make a Scrape from the tracker: How To Know the number of Seeds/peers for a torrent in PHP Sending Scrape request for Getting torrent’s Seeds and peers Has an indication to…
-
1
votes1
answer123
viewsA: Slider with jQuery on Wordpress is not running on IE
The standard method of shooting jQuery commands in Wordpress is to encapsulate everything in: jQuery(document).ready(function($) { // $ poderá ser usado como atalho de jQuery // Nosso código });…
-
4
votes4
answers8606
viewsA: popup open only 1 time after being closed, even after reloading page
Here a solution without jQuery. Example of functions for Cookie of this reply in Soen and the Domready this other also in Soen. The CSS is from Modal Reveal plugin, but used only for testing and…
-
2
votes2
answers401
viewsA: Problem with multi editor in Wordpress
It is difficult; if not impossible... I went to school the old qTranslate forum that Qian Qin (the author) had on the plugin site and never appeared solution. Now in 2014 I’m not sure, but before…
-
2
votes2
answers1383
viewsA: How to modify a wordpress plugin’s menu title?
You can manipulate the global variable $submenu and change that there (we also have the variable $menu, but it has no use here): add_action( 'admin_menu', function() { add_menu_page( 'Gallery',…
-
2
votes1
answer325
viewsA: Create menus in Wordpress Dashboard
The functions add_menu_page and add_submenu_page are just like that, if you want to fill out that question you will have to customize everything from the <h2>Insira um artigo</h2>. But…
-
2
votes1
answer853
viewsA: Remove access to a particular feature in Wordpress
In fact, you need a plugin, only you’ll write it yourself ;) I posted the following plugin originally in question Users Role and Access, translated and adapted here (missing the example…
-
3
votes2
answers1529
viewsA: Image URL with the_post_thumbnail()
If you’re inside the Loop, the post ID is known by WP, so just use the function get_post_thumbnail_id() parameter-less. If you’re outside the Loop, is a matter of using…