如何在wordpress URL中添加类别和子类别(How to add Category and sub category in wordpress URL)
如何在wordpress URL中添加类别和子类别。 在设置 - >永久链接设置我将我的网址结构更改为
/%category%/%postname%/%post_id%/
但仍然url结构是product/postname/
我如何将其更改为www.mydomain.com/category/subcategory/postname
任何人都可以帮忙吗?How to add Category and sub category in wordpress URL. In settings -> permalink settings i change my url structure as
/%category%/%postname%/%post_id%/
but still url structure isproduct/postname/
how can i change this towww.mydomain.com/category/subcategory/postname
anyone can help?
原文:https://stackoverflow.com/questions/42922007
最满意答案
如果
main
不是叶子函数,它需要对齐堆栈以获得它调用的任何函数。 未调用main
函数只保持堆栈的对齐。lea 4(%esp), %ecx # ecx = esp+4 andl $-16, %esp pushl -4(%ecx) # load from ecx-4 and push that
它正在推送一个返回地址的副本,因此在对齐堆栈后它将位于正确的位置。 你是对的,不同的序列会更明智:
mov (%esp), %ecx ; or maybe even pop %ecx andl $-16, %esp push %ecx ; push (mem) is slower than push reg
正如Youka在评论中所说,不要期望
-O0
代码完全优化。 使用-Og
进行不会干扰可调试性的优化。 gcc手册建议用于编译/调试/编辑循环。-O0
输出比优化代码更难阅读/理解/学习。 映射回源代码更容易,但代码很糟糕。If
main
isn't a leaf function, it needs to align the stack for the benefit of any functions it calls. Functions that aren't calledmain
just maintain the stack's alignment.lea 4(%esp), %ecx # ecx = esp+4 andl $-16, %esp pushl -4(%ecx) # load from ecx-4 and push that
It's pushing a copy of the return address, so it will be in the right place after aligning the stack. You're right, a different sequence would be more sensible:
mov (%esp), %ecx ; or maybe even pop %ecx andl $-16, %esp push %ecx ; push (mem) is slower than push reg
As Youka says in comments, don't expect code from
-O0
to be optimized at all. Use-Og
for optimizations that don't interfere with debugability. The gcc manual recommends that for compile/debug/edit cycles.-O0
output is harder to read / understand / learn from than optimized code. It's easier to map back to the source, but it's terrible code.
相关问答
更多-
main()的序言中堆栈指针对齐的目的是什么?(What's the purpose of stack pointer alignment in the prologue of main())[2023-05-11]
System V AMD64 ABI( x86-64 ABI )需要16字节的堆栈对齐。 double需要8字节对齐,而SSE扩展需要16字节对齐。 gcc 文档在它的文档中指出了-mpreferred-stack-boundary选项: -mpreferred-stack-boundary = num 尝试保持堆栈边界对齐到2个字节的边界。 如果未指定-mpreferred-stack-boundary,则缺省值为4(16字节或128位)。 警告:在禁用SSE扩展的情况下为x86-64体系结构生成代码时, ... -
如何从汇编代码中调用C函数printf作为整数(How to call C function printf for an integer from assembly code)[2023-05-28]
64位Linux的调用约定与32位Linux的调用约定大不相同。 请查看: http : //en.wikipedia.org/wiki/X86_calling_conventions#System_V_AMD64_ABI 更改 pushq -8(%rbp) pushq $fmtdec call printf add $16, %rsp 至 mov $fmtdec,%rdi mov -8(%rbp),%rsi xor %eax, %eax call printf 并认为这会在RDI中覆盖您以前的“返回值 ... -
对于典型的32位调用约定和典型的序言,上面或在ebp+08h处的值是过程参数。 ebp以下的值是本地变量。 ebp的值是旧的帧指针, ebp+04h的值是返回地址。 查看调用约定 。 访问esp下面的内存(当心: esp not ebp )是不可预测的,但上面的地址很好( 正是因为堆栈向下增长)。 SYS V x64 ABI定义了一个低于rsp的红区,无论如何都可以使用。 For typical 32-bit calling conventions and a typical prologue the va ...
-
我认为你正在错误地访问函数arg,偏移4个字节。 当你创建一个堆栈帧时, 第一个arg是[ebp+8] ,但是你从[ebp+12]加载 。 (这适用于在堆栈上传递args的所有调用约定。我认为32位mingw默认为double 。) 这意味着您正在使用的double precision值具有高4字节,无论调用者在8字节arg插槽上方的堆栈上发生了什么。 这解释了为什么调用者中的更改会影响函数的行为,以及为什么可以获得无限循环:如果加载的字节恰好代表一个非常小的double ,则循环永远不会退出。 低4字节( ...
-
p = (char *)((int*)(p)); p = (int*)(p+1); 。 它仍然是一个char的指针。 该转换仅用于更改表达式中的值(或类型)。 它适用于从变量中提取的值的副本,但不会修改这些变量。 一旦表达式结束,演员就会与其关联的值副本一起消失。 例: signed char c = -1; int i; i = (unsigned char)c; 这里c ,-1的值被转换/转换为unsigned char类型。 如果字符为8位,则(unsigned char)-1的结果为255,此值为 ...
-
ht_new((*functionPtr)(fork), 30) 这会调用函数functionPtr指向,传递fork ,然后将结果传递给ht_new 。 你想要的只是将functionPtr传递给ht_new : ht_new(functionPtr, 30) ht_new((*functionPtr)(fork), 30) This calls the function functionPtr points to, passing it fork, and then passes the resu ...
-
来自printf的意外结果(Unexpected result from printf)[2022-10-17]
ASCII 13是回车符,在某些系统上,它只是将光标移动到刚才所在行的开头。 进一步的字符然后擦掉早先的文本。 ASCII 13 is carriage return, which on some systems simply moves the cursor to the beginning of the line you were just on. Further characters then wipe out the earlier text. -
而不是在你的代码中 //printf below calls functions so it can print out your results printf("Division = %f Multiplication = %f", divide(num1, num2), multiply(num1, num2)); 重写如下 // call your functions here and fill variables with results float divResult = divide(num ...
-
为什么调用printf导致main的不同函数序言?(Why calling printf result in a different function prologue for main?)[2023-04-27]
如果main不是叶子函数,它需要对齐堆栈以获得它调用的任何函数。 未调用main函数只保持堆栈的对齐。 lea 4(%esp), %ecx # ecx = esp+4 andl $-16, %esp pushl -4(%ecx) # load from ecx-4 and push that 它正在推送一个返回地址的副本,因此在对齐堆栈后它将位于正确的位置。 你是对的,不同的序列会更明智: mov (%esp), %ecx ; or maybe even pop %ecx ... -
char* folder_dest; scanf("%s", folder_dest) folder_dest未在程序中初始化并指向随机存储器地址。 然后, scanf将在写入字符时调用未定义的行为。 使用字符数组而不是char指针。 更好的解决方案是使用fgets加上sscanf而不是scanf 。 char* folder_dest; scanf("%s", folder_dest) folder_dest is not initialized in your program and points ...