Posts by Caio Felipe Pereira • 4,570 points
135 posts
-
1
votes2
answers1286
viewsA: Take variable parameter Javascript/React function
If you change your method set for set = (s, v) => { this.setState({ [s]: v }) } (note the [] involving the key s) you must achieve your goal. This is called Computed Property Names…
-
8
votes1
answer657
viewsA: React Component vs Stateless Functional Components
There are extra differences (apart from the state issue) between the use of statements? Yes and no. It is possible, at least in theory, to accomplish everything you would do with stateless…
reactanswered Caio Felipe Pereira 4,570 -
2
votes1
answer142
viewsA: Form with list in React
Just to formalize the answer and help other people who might come here: There is a simple solution, among some others, to get the value of a child component within a parent component, which is to…
-
2
votes2
answers3687
viewsA: Catch state of child component in React
You can create a specific state to carry that number in the parent component, plus a method that goes to the child component (via props) and change this previously defined state. With the status…
-
0
votes3
answers205
viewsA: React-chartjs-2 graphics do not load on screen
Your code has some improvement points, but I believe your problem is being dealt with by two things: The fact that you are making the request before the component assembles and the fact that you are…
-
2
votes1
answer207
viewsA: How do I not map a Class with the Entity Framework
You can use the Dataannotation [NotMapped] namespace ControleGCD.Models { public class Certificado { //... public DateTime CertificadoDtCadastro { get; set; } [NotMapped] public DateTime…
-
4
votes1
answer593
viewsQ: Return message together with Unauthorizedresult
I am using . NET Core 2 to create a dependency that will be injected into an API. The idea is to create a middleware to control incoming requests and act according to a number of business rules. It…
-
1
votes1
answer439
viewsA: Flexbox: Is it possible to force 100% wide on a daughter div with space-between on the father?
You can force the size without problems: .pai { display: flex; justify-content: space-between; width: 400px; flex-wrap: wrap; } .filha { background-color: green; padding: 1rem; margin: 1rem;…
-
0
votes1
answer721
viewsA: Responsiveness on iphone
Your featured images (.featuredImage img) has a fixed height and width (this is just one of the two occurrences I found in your code): .featuredImage img{ height: 222px; width: 318px;…
-
3
votes2
answers161
viewsA: Don’t events work with dynamic video?
Your problem is known, and it’s called delegation of events. You see, you said yourself you create the elements dynamically. This means that at the moment you declare the event routine, some…
-
1
votes1
answer423
viewsA: How to limit the overall number of Wordpress posts from two different loops
For each of the loops, just add the pagination parameter posts_per_page, to add the last 3 posts. (See the pagination parameters here). This way, you’ll have something like $query1 = new…
-
5
votes1
answer4927
viewsA: Pass variable to html page with Nodejs
You cannot access a variable from an application server side written in Node at client side, directly in the browser. Although the programming language is the same, there are two runtimes totally…
-
0
votes1
answer343
viewsA: Custom Post Type Display Linked to Common Posts
Your problem is here: <?php if (have_posts()) : foreach( $query as $post ) : setup_postdata ( $post ); ?> Which shows that your report is correct: only appear when I leave a post created in…
-
1
votes1
answer137
viewsA: Create a role in WP for when to log in to be redirected
There is a filter (read about filters here) in Wordpress called login_redirect. In a very short way, filters allow you to perform certain actions on "events" data that occur in the WP stream. The…
-
0
votes1
answer435
viewsA: I am trying to install Ionic 2 but it is giving error in the time to run npm install -g Ionic codova
The warnings of the NPM (WARN) should not prevent the operation of your package. They occur when something could be improved, or when some method is deprecated, or when some other package is…
-
0
votes1
answer255
viewsA: How to use the Urlfetchapp class with Node.js
The method you are looking for (Urlfetchapp) is part of the Google Apps Script. The description says: Increase the power of your Favorite Google apps - like Calendar, Docs, Drive, Gmail, and Sheets.…
-
7
votes2
answers2038
viewsA: How to transform text into input text when clicking?
How about using a div (or p, span, you know) of editable content? There’s an attribute just for that. Behold <p contenteditable="true">Este texto é editável. Clique aqui e veja…
-
0
votes0
answers29
viewsQ: When to use literal array notation in JS?
I started using the Jshint in my projects, together with the Sublime Linter (which, by the way, I recommend). After doing the setup I came across the following warning:: The literal array Notation…
-
5
votes2
answers6376
viewsA: Center a div with text and position Absolute in the center of div pai
Creating a div father with position: relative, and the div son with position: absolute must solve their problem, provided that the div child is positioned at a distance equivalent to 50% of the…
-
6
votes2
answers275
viewsA: How to use jQuery’s reverse function to undo something?
hover is not a Handler that the method on() you understand. jQuery makes events available mouseenter and mouseleave. To make the developer’s life easier, there is the method hover(). According to…
-
1
votes4
answers4799
viewsA: How to turn a rectangular image into a circle (without distorting it)
You can use the property clip-path, but see that she has a support not so good. img { width: 350px; height: 300px; } .circle { clip-path: circle(150px at center); -webkit-clip-path: circle(150px at…
-
3
votes3
answers2011
viewsA: jQuery Run CSS Animation only when content is visible to the user
The problem is that you are (probably) adding the class when the DOM is ready (i.e., $(document).ready()...), and this does not mean that the element is visible. You can create a method that checks…
-
1
votes1
answer1030
viewsA: How to get title and content on another page?
You can, in the page template "home", create a loop specific searching page information "who we are". Something like that $query = new WP_Query(array( 'pagename' => 'quem-somos' ));…
-
0
votes2
answers317
viewsA: Problems with jQuery printing function
I will suggest another approach to this problem, which involves the use of the event load. Despite the event ready ensure that the whole structure of the DOM is already built, it does not guarantee…
-
2
votes1
answer545
viewsA: Simulate automatic typing
There is a plugin that does this called Typer.js. Interestingly, in my searches, I found completely different implementations of this effect, which bear the same name (!). The one I posted on the…
-
7
votes3
answers4045
viewsA: How to add <li> dynamically in <ul> with jQuery?
It seems to me that you are always deleting the contents of #taskItem and filling it with the new value, so that you always have only the last presented by loop. Basically, the method of html()…
-
2
votes3
answers547
viewsA: wp_enqueue_script does not work
The jQuery, as well as several other scripts, is already included in core Wordpress, and they work on-demand, that is, only when necessary. What happens is that, within the logic of WP, you can…
-
5
votes1
answer328
viewsA: Run a function after purchase status confirmed
You’re looking for a Action, in particular the woocommerce_payment_complete. Here you find a (extensive) list of all Hooks that Woocommerce makes available. Basically, you create a action of the…
-
0
votes1
answer71
viewsA: Customizing the post presentation in the wordpress looping
To do things like "once this, once that," you can use the operator module. This operator works by returning the rest of a division. In such a way, just have a counter to control each time you pass…
wordpressanswered Caio Felipe Pereira 4,570 -
1
votes1
answer500
viewsA: Why does the Hover effect stop working on these css buttons when I resize the screen?
As far as I could tell from your code, the problem is not the resizing of the screen, but the fact that your :hover does not hit any selector. I explain: In this answer I talk a little bit about…
-
1
votes1
answer330
viewsA: CSS attribute with text line condition
You can use the pseudo-selector :not() CSS. It always works with a selector (input, .minha-classe, #essa-div, p, ...) excluding from it what is within the parentheses. There is a technical…
-
0
votes1
answer37
viewsA: Restrict number of recent TAB posts
Without getting into the merits of paging, you can limit the number of posts that your query returns through $displayposts = new WP_Query('posts_per_page' => 4);…
wordpressanswered Caio Felipe Pereira 4,570 -
2
votes1
answer1880
viewsA: How to apply formatting to the parent element through the child element class with CSS or SASS?
TL;DR: Do not exist Parent selectors in the CSS (yet). There are several ways to dynamically select the parent of an element, but they all involve a bit of Javascript such as the method parent()…
-
2
votes4
answers63
viewsA: Positioning of li’s on the page
You can use Flexbox. Most of browsers has a well-consolidated implementation, according to the Can I Use. I’m assuming that your list will be horizontal, meaning the <li>will be next to each…
-
20
votes3
answers20650
viewsQ: When to use Success: Function() and . done(Function()) in asynchronous requests?
Simply put, I can write an asynchronous request like: $.ajax({ url: url, dataType: 'json', type: 'GET', success: function (_user){ alert (_user) } }); that alerts me to the return _user. Likewise, I…
-
0
votes1
answer1603
viewsA: List categories of a custom post
You can use the method wp_get_object_terms() to rescue both the tags as to the Categories, since both are taxonomias. In a minimalist way, it is possible to do <?php if(have_posts()){…
wordpressanswered Caio Felipe Pereira 4,570 -
0
votes1
answer46
viewsA: How to replace image code in posts?
In your case, I believe the best solution would be to use a Parser de HTML, that allows you to find the tags HTML as well as jQuery. However, I don’t know how your WP code is structured, nor if you…
wordpressanswered Caio Felipe Pereira 4,570 -
0
votes2
answers476
viewsA: Filter element from taxonomy in wordpress
If you have the ID of the category in $categoria_post, you can use the method get_category() $categoria = get_category($categoria_post) and access it with $categoria['slug'] Just remembering that…
-
1
votes1
answer282
viewsA: Wordpress Thumbnails in Custom Post Type
It is sufficient that in the second parameter of register_post_type(), you add the following: 'supports' => array( 'thumbnail ') As can be seen in the documentation, the array supports is where…
-
1
votes1
answer114
viewsA: Generate a minified file for each file inside a folder
Yes. Just that your attribute src delete this particular file. In a simple way, this could be solved with the following task: gulp.task('js', function(){ return gulp.src([…
-
3
votes1
answer49
viewsA: Problems in Child Nth
Changing your selector of nth-last-of-type for nth-child you solve the problem // Apenas um facilitador para adicionar li s $('button').click(function(){ $('ul').append('<li class="col-md-6…
-
5
votes1
answer355
viewsQ: Gulp tasks with command line parameters
I work with a simple task of Gulp, created to realize a deploy in a production environment. In a simplified way, the task is: gulp.task('deploy-prod', function () { return gulp.src('dist/**')…
-
1
votes1
answer317
viewsA: failed to use get_header in wordpress
get_header() is a WP method. Therefore, to be used, it needs to somehow be within the context of WP. From what I could understand from your question, you created the theme (i.e., index.php,…
-
2
votes1
answer97
viewsA: Hide DIV only in IE8
Create a file .css called, for example, ie.css. Make your call in the header of your page/site/application as follows: <!--[if lte IE 8]> <link rel="stylesheet" type="text/css"…
-
2
votes1
answer1826
viewsA: Rectangle/cone with css only
.trapezio { border-top: 50px solid blue; border-left: 25px solid transparent; border-right: 25px solid transparent; height: 0; width: 50px; } <div class="trapezio"></div> Here’s an…
cssanswered Caio Felipe Pereira 4,570 -
1
votes2
answers418
viewsA: What javascript function do I use to extract an HTML block from one place and insert it into another on the same page
Using jQuery, you have several ways to do this. I don’t know if it’s the most performative or the most elegant, but it solves the problem. See: var _h1 = $('#courseheader').html(); var _container =…
-
0
votes2
answers114
viewsA: Form with multiple windows
I had to slightly alter yours HTML but basically what was missing for its code to work was the inclusion of the jQuery. Without him, $(window).load() and more other methods do not exist. I have…
-
5
votes2
answers3032
viewsA: Test a new theme in Wordpress without losing the previous theme changes
I wonder if I install another theme in my wordpress that is already online, if I run the risk of losing what I already have if I want to go back to the previous theme No. Wordpress allows you to…
-
15
votes2
answers1645
viewsA: What are the structural and syntax differences between Sass, Less and Stylus?
whether they fulfil the same role, or whether they have a different approach. This phrase of yours sets the tone of your question. I will try to base my answer on both points cited. They play the…
-
4
votes2
answers373
viewsA: List POSTS in Wordpress by views
You have to make a query a little more complex, which will lead you to seek a solution beyond the loop principal (i.e., <?php while ( have_posts() ) : the_post() ; ?>), but it’s not that…