Posts by Alê Moraes • 883 points
61 posts
-
1
votes1
answer29
viewsQ: Scan list and compare with an Array in Javascript
I have a list: <ul id="lista"> <li><span class="datas">01/01/2020</span></li> <li><span class="datas">02/01/2020</span></li> <li><span…
javascriptasked Alê Moraes 883 -
0
votes1
answer614
viewsQ: Sum values from a date in Excel
I have an excel spreadsheet with two tabs Aba Cálculo Aba Valores In the Calculation tab you have a field to date. In the Values tab there are two columns one with the month and the year and the…
excelasked Alê Moraes 883 -
0
votes1
answer32
viewsQ: Turn text into breadcrumb links
I have two variables var link_breadcrumb = "geral1_titulo1_parte1_conteudo1"; var texto_breadcrumb = "Geral 1 - Título 1 - Parte 1 - Conteúdo 1"; I would like to assemble the breadcrumb with the…
-
0
votes1
answer74
viewsQ: Making Data-type Breadcrumb from a <li> Scrolling Down Page
Can someone help me with that. I have the page and html which is a giant list. Each < li> has a date field in it <li class="classe_dia" data-dia="12">Conteúdo</li> <li…
-
0
votes1
answer637
viewsQ: Does not load the style.css in wordpress
I am studying Wordpress, but, I could not use functions.php to load the stylesheet These are the files css style. /* Theme Name: Tema Estudo Author: A Version: 1.0.0 */ body{ color: #4d5a6c…
-
-1
votes1
answer318
viewsQ: Search post and load it into a div using Ajax in Wordpress
I have the following structure in wordpress. <input type="text" id="busca_artigo"> <button id="btn_busca_artigo">Enviar</button> <div id="resultado_pesquisa"></div>…
-
1
votes2
answers357
viewsQ: Concatenating the elements of an array
I have an array in Javascript: var array_soma = [ "parte 1", "parte 2", "parte 3", "parte 4", ]; I would like to concatenate each element for the array to look like this: var array_soma = [ "parte…
-
0
votes1
answer61
viewsQ: Find out which function is called in the click
I have a site in wordpress and use Bootstrap 4. In the footer I have a link to go back to the top of the page. When I click it shows the animation of the page going up. I generated with javascript…
-
2
votes2
answers70
viewsQ: Javascript or Jquery - how to do a Divs class inventory
I have a div of id=colors and inside I have other Ivs with several classes <div id="cores"> <div class="azul">conteúdo</div> <div class="amarelo">conteúdo</div> <div…
-
-2
votes1
answer50
viewsQ: PHP captures date text
I have a list of those values: <li data-breadcrumb="Caixa 1 - Quarto 2 - Casa 3"> Conteúdo </li> And I’d like to reverse their order in PHP. I did a function function…
phpasked Alê Moraes 883 -
1
votes2
answers940
viewsA: How do I display the content of my wordpress pages?
Just put "the_content();" after while ( have_posts() ): the_post();, as in the example below. <?php if ( have_posts() ): while ( have_posts() ): the_post(); the_content(); endwhile; else: _e(…
-
0
votes1
answer75
viewsQ: How to capture the id of each line in a list with scroll?
I have a list of 200 lines, and each line has its id. I would like to capture with javascript, the id of each line when scrolling down the page. The list is assembled this way: <ol…
javascriptasked Alê Moraes 883 -
2
votes1
answer43
viewsQ: Body selector does not work in wordpress jquery, only '*'
I’m making a site using wordpress and bootstrap. I initially made the site in php and converted to a wordpress theme. I don’t know what happens with jquery selectors, they work in pure php, but not…
-
2
votes1
answer93
viewsQ: Transform into ul
Hello, all right? PHP can take tabs-formatted text and turn it into a ul? José Dados Idade: 30 Estado Civil: Solteiro Hobbies Tocar violão Rock Blues Ler Viajem Praia And I’d like to turn to look…
-
0
votes2
answers38
viewsQ: Preg_replace_callback put text before number
I have a text that follows like this: Id - Name: Age - Phone 500 - Antonio: Age: 35 years - phone 3681-08xx Preferences: ride a bike, travel. 1,500 - Rodrigo: Age: 20 years - phone 3685-40xx…
phpasked Alê Moraes 883 -
2
votes1
answer65
viewsQ: Jquery find key from a value
I have an array with values that vary according to the page. I’d like to know how to catch the key of a specific value. Example: minhaarray = [5,10,15,20,25] How do I extract the key of a value 15?…
-
0
votes1
answer62
viewsQ: Multiple wp_query without repeating category
I have a wp_query that filters three categories cars, clothes and music, the order is in Random. I would like the result to alternate without repeating the category. <ul> <?php $paged =…
wordpressasked Alê Moraes 883 -
2
votes1
answer39
viewsQ: Capture two parts of the same string?
I have a list of names that follow this structure: Diretoria: (aprovação 23, de 2014) Diretoria: (aprovação 42, de 2015) Diretoria: (aprovação 70, de 2016) How do I capture the numbers separately…
phpasked Alê Moraes 883 -
1
votes2
answers67
viewsQ: Wordpress reads logo only on localhost
On the site I made the logo works when I’m testing at home with the localhost, but on the site it doesn’t read. <img id="logo_topo" class="img-responsive" src="<?php bloginfo('template_url');…
wordpressasked Alê Moraes 883 -
0
votes1
answer40
viewsA: Import XML into Wordpress cuts the permalink address
I found the problem. In XML to import, in addition to the "link" field you have to also change the "post_name field" So the "link" field looks like this…
-
0
votes1
answer40
viewsQ: Import XML into Wordpress cuts the permalink address
I don’t know why you’re like this. I have the latest version of XAMPP, and use wordpress 4.5.2. I’ve assembled an xml file with all the posts I need to import, but when I import it cuts the middle…
-
0
votes1
answer242
viewsQ: Replace text with srt_replace using double quotes
I am trying to use str_replace to change a part of the code, $mudali = "li id=\"cabeca{$raiz}\" class=\"cabeca\""; $mudali2 = "li id=\"pes{$raiz}\" class=\"pes\""; echo $mudali; // resultado li…
phpasked Alê Moraes 883 -
0
votes0
answers61
viewsQ: Save two cookies, one to the root and one to a subpage
I’m wanting to use cookie on my site to change style, but, I have conflicts, I asked the question on this link: Stylesheet with cookie works only the second time The solution Bacco presented worked,…
-
1
votes1
answer38
viewsQ: Stylesheet with cookie works only the second time
I have a site that the style is set by the cookie "standard" or "dark" However, if you enter it the first time it saves the cookie with "default" value, but it does not take the style. It only works…
-
0
votes1
answer90
viewsQ: Capture all ID with preg_match
I have two div <div id"opcao1"></div> <div id"opcao1a"></div> I am using this function to capture the id function obterID($string) { $res = preg_match('~id="([\w]+)"~i',…
phpasked Alê Moraes 883 -
3
votes1
answer536
viewsQ: Invert separate word order with str_replace in PHP
I have a string opção1_opção2_opção3 I used str_replace to separate the options $titulo = str_replace("_"," ",$titulo ); I got a way out opção1 opção2 opção3 I’d like to reverse the order to stay…
phpasked Alê Moraes 883 -
0
votes1
answer128
viewsQ: Jquery captures ID of div in scroll and changes title
I have a page with a title and several Ivs with different subjects and their own Ids, I would like that when descending the screen, jquery captures the ID that is visible and puts in the title.…
jqueryasked Alê Moraes 883 -
1
votes0
answers120
viewsQ: Wordpress duplicates the permalink
In wordpress on the homepage are all the posts I made. In each post has the title and a photo. In the title, the title link is correct, for example: `meusite.com.br/post1` But in the photo, the link…
-
0
votes3
answers125
viewsQ: mysql UPDATE, does not receive function value in PHP
I have that function: $id = pega_assunto_por_nome_menu($_GET['assunto'])['id']; That returns the id value if you use echo $id; But when I update to mysql, it doesn’t work. This error appears: You…
-
3
votes1
answer42
viewsQ: Functions.php or functions.fcn
I learned to include a file .fcn I wonder if there is a difference between including a functions.php file and a functions.fcn file.
phpasked Alê Moraes 883 -
1
votes2
answers1394
viewsQ: Mysql returns only the first record
I created this function, but, it returns only the first record of the table. function pega_conteudo_pela_id($id_assunto){ global $conexao; $query3 = "SELECT * FROM `{$id_assunto}`"; $result3 =…
-
1
votes0
answers159
viewsQ: Import XML into Mysql
I have two xml files. When I care one of them comes like this pública and the other one comes like this pública I opened the files in Notepad++ and in the Format tab the two files are with UTF-8…
-
1
votes2
answers4468
viewsQ: Favicon does not appear
I generated the icon on http://www.favicon-generator.org/ I pasted the code that appears in the head after the tag <title>. And the images are in the root of the folder along with index.php…
-
2
votes2
answers208
viewsQ: With or without Wordpress
Good afternoon, I am working... well, actually, studying PHP and would like to work with the Brazilian laws. I know the work is hard, but I’m slowly getting. But, I do not know if I use wordpress as…
-
2
votes2
answers672
viewsQ: PHP include problem with characters
I’m using include in two files. One file usually includes, however, the other comes with problems in the characters appears in the accents the character "". But opening the two files on notepad++,…
-
1
votes1
answer2422
viewsA: Bootstrap dynamic menu with PHP and Mysql
I managed to get the result I intended, this is the script $assuntos = "SELECT * FROM assuntos"; $resultado_assuntos = mysqli_query($conexao,$assuntos); while ($linha_assunto =…
-
2
votes1
answer2422
viewsQ: Bootstrap dynamic menu with PHP and Mysql
I have in mysql two tables (subjects and pages), the table pages has a field (assunto_id), which relates which subject is that page. I would like to mount a menu with submenu in bootstrap This is…
-
2
votes1
answer153
viewsQ: Sublime Text read Less file with CSS syntax
Someone knows how to make Sublime Text open Less file and recognize its syntax. When I open the file . Less, tighten crt+shift+P and choose Set Sintax: CSS, but I have to do it every time. Someone…
sublime-textasked Alê Moraes 883 -
0
votes1
answer66
viewsA: Orderby custom field alters the Loop in wordpress
I managed to accomplish with if (is_category( )) { $cat = get_query_var('cat'); $yourcat = get_category ($cat); $yourcats = $yourcat->slug; } query_posts('category_name='.…
-
0
votes1
answer66
viewsQ: Orderby custom field alters the Loop in wordpress
In my blog, I have different categories, and in each post I created a custom field with the key posicao with numeric values. This is the code I have $query = new WP_Query(array( 'meta_key' =>…
-
0
votes2
answers220
viewsA: preg_replace with Regex to add a tag
I managed to accomplish what I wanted with jquery this is the code $('p').filter(function(){return $(this).text().match(/^[a-z]\)\s/) }).parent().addClass( "alinea");…
-
0
votes2
answers56
viewsQ: Add class to Regex result in preg_replace
I would like to add the class with regex and preg_replace echo preg_replace("/<li\>\s*<p\>[a-z]\)\s/", "/<li class=\"inciso\"\>\s*<p\>[a-z]\)\s/", $documento); This is the…
-
2
votes1
answer333
viewsQ: Select all elements of an array in a variable with Regex in PHP
I would like to do a regex to apply a class to each row with Roman numbers, the regex would be? /(<li>\s*<p>$romanos\)_\-_/ ? The documents are like this: <li> <p>I -…
-
1
votes2
answers91
viewsQ: PHP reads two Txts files differently
I have two txts files, I used Notepad++ to do the text. PHP reads a normal file with the word TITLE, but the other appears T?ULO. Does anyone know the reason, or how to fix this problem?…
phpasked Alê Moraes 883 -
0
votes1
answer62
viewsQ: Involve similar tags
[1] This is an example of what I would like to do, but I don’t know how to apply it to my case. I would like to wrap items of the same type in a ol his. Original text: <li> <p>a) texto…
-
2
votes2
answers220
viewsQ: preg_replace with Regex to add a tag
Does anyone know how to make regex select the phrase and add a tag? <li> <p>b) texto muito longo;</p> </li> $FechasemClassAlinea =…
-
1
votes1
answer523
viewsQ: Foreach in PHP skips the first pass
I’m still new to PHP, so whoever helps, I ask for patience, kkk. The foreach is at the end of the code, before it’s just the text of the articles I made a foreach to concatenate the ID of a single…
phpasked Alê Moraes 883 -
3
votes5
answers17941
viewsA: How to use the loop for(for) in Portugol?
In other words the function will do the same task a certain number of times Example in a race: It will start with around 0 /int x = 0; (in Lucas Henrique’s model) It will have 100 laps // x <=…
-
-1
votes2
answers1278
viewsQ: Defined variable, but shows as undefined
I have the following code: <?php // Lê conteúdo do txt $documento = 'TÍTULO I Dos Princípios Fundamentais Art. 1º A República Federativa do Brasil, formada pela união indissolúvel dos Estados e…
phpasked Alê Moraes 883 -
2
votes1
answer82
viewsQ: Concatenate hierarchy
I have the following code: <?php function obterID($string) { $res = preg_match('~id="([\w]+)"~i', $string, $IDs); if ($res){ return $IDs[1]; } else { return ""; } } // Lê conteúdo do txt…
phpasked Alê Moraes 883