Posts by brasofilo • 6,560 points
159 posts
-
0
votes1
answer771
viewsA: Redirect any Domains to my server
Instead of using Registry.br DNS, you have to point DNS to your hosting Nameservers, usually ns1.nomedohosting.net: And in your dashboard, e.g. cPanel, add the wildcard record:…
-
1
votes3
answers831
viewsA: Customizing the Javascript confirm
So much for the confirm, alert or prompt, besides line breaking \r, new line \n and tabulation \t, you can use Unicode, for example underlined letters and this whole list of symbols to build…
-
0
votes1
answer493
viewsA: Enable "highlighted image" on specific Wordpress pages
This refinement can only be done with CSS or Javascript. The action is applied only on the pages wp-admin/post.php and wp-admin/post-new.php. The global $current_screen has the Post Type information…
-
1
votes1
answer29
viewsA: Doubts about backup, templates and domains in the Multisite Network in Wordpress
1) The ideal is to use specialized plugins (the best is to search for blog articles analyzing the current options). But to do the basics, just export the specific tables of each site, which are…
-
2
votes2
answers70
viewsA: How to remove registered custom post types from custom Fields list?
So that your Custom Fields do not appear in the list of a post/page/CPT, have to use a underscore at the beginning of the name. For example, this appears on the list: meu_custom_field. This nay…
-
0
votes1
answer107
viewsA: How to get the posts on a facebook page (not downloaded by me) using the Graph-api?
Yes, it is possible, but your app or website will need get a credential (token) for the user to query. /{page-id}/feed The feed of posts (including status updates) and links Published by this page,…
-
0
votes1
answer336
viewsA: How to receive a facebook username? Graph API
The Graph API no longer allows search for username. I also just checked the documentation and there’s nothing there about. I saw that the Facebook HTML contains two meta tags with User_id: <!--…
-
0
votes1
answer455
viewsA: Facebook API - Pulling posts with Hashtag
Is not possible... Facebook is Shutting Down Access to Hashtags in its API (April 2015) The explorer doesn’t even work to search the hashtags anymore, as suggested here: Facebook API search for…
-
2
votes1
answer269
viewsA: Facebook API , recover first name
Use Graph API Explorer to test your darlings before doing the programming: https://developers.facebook.com/tools/explorer/? method=Get&path=me? Fields=id,name,email&version=v2.9 When it’s…
-
5
votes1
answer341
viewsQ: How to find out which template Wordpress is using on a site page?
I’m often not sure exactly which Theme file is generating a page from the site, for example, http://example.com/nome-da-pagina-post. What I do is I put one echo within each Theme template,…
-
1
votes1
answer341
viewsA: How to find out which template Wordpress is using on a site page?
The global variable $template contains this information. We can put a filter in the the_content to print this and make it appear only to the administrator: add_filter( 'the_content',…
-
1
votes1
answer57
viewsA: How to create a shorcode with an extensive PHP code?
Brute force solution, use ob_start() and see if it works. See: Output « Shortcode API « Wordpress Codex PHP: ob_start - Manual Wordpress Shortcode with ob_start() copy function my_shortcode() {…
-
1
votes1
answer693
viewsA: Receive a parameter through a friendly URL on a Wordpress page
Must use a endpoint through function add_rewrite_endpoint(): # conferir outras possibilidades além do EP_ALL na documentação add_rewrite_endpoint( 'recordings', EP_ALL ); The endpoint should be…
-
1
votes2
answers359
viewsA: Capture visitor IP on a Wordpress site in.txt file
Copying and pasting codes found in the OS and WPSE, follows a very simple plugin to do this. I added a function to capture the type of page being viewed (home, Category, search, tag, etc). The…
-
1
votes1
answer87
viewsA: Display image on Twitter Wordpress Cards without plugin
You must create an auxiliary function to pull the highlighted image or in its absence any image associated with the specific post. All failing, put a default image of the site. Here, check if the…
-
0
votes1
answer38
viewsA: How do CPT registration go to a specific page?
Check out Custom Post Types « Wordpress Codex (the original in English is more complete) where you will see for example: $args = array( 'post_type' => 'product', 'posts_per_page' => 10 );…
-
5
votes1
answer905
viewsQ: Is it possible to modify the HTML when writing an email in Gmail?
The intention is very simple, I want to make a <strike> (strikethrough) in the text of the email, p.ex.: tacked. I found the library Kartiktalwar/gmail.js: Gmail Javascript API, but it…
-
5
votes1
answer905
viewsA: Is it possible to modify the HTML when writing an email in Gmail?
You can directly use the Developer Tools DOM manipulation that the browser (browser) offers. It is not straightforward or beautiful like creating an extra button for formatting, but for an HTML…
-
1
votes1
answer11053
viewsA: How to download an image from a URL?
The first is to make sure that the destination folder on the server has the correct permissions. I tested with this PHP manual code and worked ok, you would have to check the error logs on your…
-
0
votes1
answer175
views -
3
votes3
answers1759
viewsA: Create post on a wordpress and bring in other wordpress automatically
According to (great) Frank Bueltge, there are three methods to do this: WP API (JSON) Feed (XML) XMLRPC API And, also according to Bueltge, we should prioritize the WP JSON API because it is the…
-
2
votes1
answer99
viewsA: Children’s Template for a Wordpress post category
Yes, just follow the Hierarchy of Templates. In your case, what you need is one of these two files in your theme: /wp-content/themes/seu-tema/category-$slug.php…
-
2
votes1
answer339
viewsA: Add item to administrative menu to save custom value
You can do this with "brute force" by creating a form on this options page and adding a admin_init that will observe if this form has been sent and if everything is secure (check_admin_referer) and…
-
4
votes2
answers480
viewsA: Remove the original image from the server after Wordpress generates the thumbnails
It is possible to do this using the following code: (source: How to Automatically use resized images Instead of Originals) add_filter( 'wp_generate_attachment_metadata', 'replace_uploaded_image' );…
-
1
votes2
answers115
viewsA: Error activating WP_DEBUG
Maybe debugging a file can work around the problem: define( 'WP_DEBUG', true ); define( 'WP_DEBUG_DISPLAY', false ); // não mostrar na tela define( 'WP_DEBUG_LOG', true ); // escrever debug em um…
-
0
votes1
answer634
viewsA: How to add a dynamic footer in Wordpress?
If you want to make an option on backend within the Settings area, you must use the Settings API. To do within the settings of the Theme you have to use the Theme Customization API. Each of them has…
-
1
votes1
answer2485
viewsA: Remove 'Continue shopping' button from checkout on Woocommerce
Looking for "Continue Shopping" in the plugin code, brings to the file wc-cart-functions.php#L88, where is this filter: wc_add_notice( apply_filters( 'wc_add_to_cart_message', $message, $product_id…
-
3
votes1
answer320
viewsA: How are Wordpress texts and content displayed from the PHP file?
Everything within PHP opening and closing tags (<?php ?>) will not appear in HTML, except that the PHP command is for print out something. Does not appear in HTML: <?php $teste = "tal…
-
4
votes1
answer2313
viewsA: How to change the "src" of an iframe without changing the user URL?
In accordance with this excellent response, the iframe is simply a relative of the old frame, then it’s only a matter of defining the target in your menu item (probably a <a>): <iframe…
-
1
votes1
answer252
viewsA: Creating Archive.php in wordpress using custom field
It seems that there is not much way, the filters available in the function wp_get_archives are not sufficient to perform this filtering. The solution is to copy the function to a…
-
2
votes1
answer620
viewsA: Install Nesbox emulator in Wordpress
One solution is to make an iframe that works alone on a URL like http://exemplo.com/wp-content/arcade/, and embed in the post or page using a basic Shortcode. You’ll need to use the…
-
1
votes2
answers310
viewsA: Page with different layout
One way to apply individual styles, for example on the Contact page, is to create a template page-contato.php. The important thing is the slug page: If that slug were sample-page, the template would…
-
1
votes1
answer141
viewsA: Create an array of custom post type links and names to use in a meta_box without changing the value of the edit post
You can’t test your code, because it’s not a Minimum, Complete and Verifiable Example, but I think the probability is too great that the problem is in the WP_Query. And also: the global $post; will…
-
3
votes2
answers87
viewsA: How to install plugins in separate accounts?
A technique is to modify conditionally constants in wp-config.php. You can have a single Wordpress file base with a single wp-config.php and serve multiple domains, each with its own separate…
-
2
votes1
answer54
viewsQ: Compare Youtube and Facebook dates
Through the YT API, I get the video date in this format (UTC): publishedAt: "2015-09-17T00:01:56.000Z" And on Facebook, inspecting the source code I see that they use: <abbr title="Quinta, 17 de…
-
3
votes1
answer335
viewsA: When I start a session in Wordpress, the template layout breaks
When the user is logged in, the WP Admin menu appears (default wordpress) which adds the following style sheets: <link rel='stylesheet' id='dashicons-css'…
-
2
votes1
answer398
viewsA: Is it possible to create a dynamic field within an Advanced Custom Field?
It is possible, yes. You will need to include Javascript/jQuery on this page and "listen" to changes in the dropdown. The changes will trigger Ajax calls and update the ACF Meta Box dynamically.…
-
2
votes1
answer200
viewsA: Display codes on the front end without being executed by Edit Post
The simplest is to use one Custom Field to paste the code and use a Shortcode to make the display in pure HTML. The post would look like this: You can use as many shortcodes as you want, just put a…
-
1
votes2
answers165
viewsA: Keep Settings when Changing URL - Wordpress - Theme: Adventure - Organic Theme
To modify Urls in the database you must always take into account the change without errors of serialized values, as in your example:…
-
1
votes1
answer265
viewsA: Sending SMTP email in Wordpress via server with self-signed certificate
It is an interesting tool in single sites, but almost essential for Multisites: Must Use Plugins « Wordpress Codex All scripts you put inside the folder wp-content/mu-plugins will be run…
-
1
votes1
answer1054
viewsA: Request movies by IMDB link
It seems that IMDB has two Apis, both completely undocumented, I searched the entire site FAQ and found nothing (6 years after the original question below on Soen). Vide Does IMDB provide an API? A…
-
0
votes1
answer50
viewsA: Custom update for Wordpress plugins
Here are the tools I’ve tested to do this: Yahniselsts/wp-update-server A custom update API for Wordpress plugins and themes. Intended to be used in Conjunction with my plugin-update-Checker…
-
2
votes1
answer493
viewsA: Why does my Taxonomy in Wordpress not work on a hierarchical level?
This is an old "problem", but considered as expected behaviour, as a core contributor *: * (Core Trac ticket - Bug (invalid) - in English) The behavior is strange, but it corresponds to the way…
-
3
votes1
answer133
views -
1
votes1
answer94
viewsA: Is there a function in Wordpress to control daughter pages?
When printing menus, you can test by is_page() and within that block confer property $post->post_parent (post_parent is a column in the table wp_posts). In the header.php: <?php if( is_page()…
-
1
votes1
answer835
viewsA: How do I pay with the Instagram API?
The MAX_TAG_ID is the point where the next page begins (in your code, you put the value of userid). PARAMETERS COUNT Count of tagged media to Return. MIN_TAG_ID Return media before this min_tag_id.…
-
1
votes1
answer212
viewsA: How to link two accounts in Woocommerce?
It will be necessary to implement several features to mount this system. And the beginning is exactly "link user accounts". Customers and representatives will play a role (role) this can be managed…
-
1
votes1
answer786
viewsA: View children (Children) just by clicking on parent term
SOLUTION: function print_produtos_e_filhos( $tax_name ) { $cats = get_terms( $tax_name, [ 'parent' => 0, 'hide_empty' => true ] ); echo '<ul>'; foreach ( $cats as $cat ): if ( !…
-
2
votes1
answer772
viewsA: What is the best way to make an AJAX request in Wordpress?
Using the second form you will load Wordpress twice: once on load page and the second when including the wp-blog-header.php or wp-load.php. Has a post on Crappy Code dedicated to it: wp-load.php - I…
-
3
votes1
answer46
viewsA: Placing explanatory boxes within the Wordpress administration?
For these specific pages you quote, what you’re looking for is a Meta Box. You have to set the post type, location and priority: add_action( 'add_meta_boxes', 'add_box_sopt_38791' ); function…