• Resolved xephia

    (@xephia)


    Hi guys!
    I’m trying to add a section below my slider and above my featured content on this site here. I found this snippet which is perfect for what I want to do!

    However, when I add the supplied code to functions.php, I get the following error message:

    Parse error: syntax error, unexpected ‘sections’ (T_STRING) in /home2/xephia/public_html/wp-content/themes/customizr-child/functions.php on line 40

    I’ve tried copying it manually, and copying it using the copy button supplied, so I don’t think it’s a case of copying and pasting incorrectly.

    Any ideas?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter xephia

    (@xephia)

    In fact, now I can’t seem to log into wp-admin, it just shows me that error ;u;

    Hi xephia,
    do you have any ftp account?
    You should rename the customizr-child dir, this way wordpress will fall back on one of the defaults themes.
    Then you can access to your child-theme functions.php, copy the whole content an put in pastebin.com. Then paste the link here, and we’ll see what was wrong. ??

    Thread Starter xephia

    (@xephia)

    I do! I tried that and got access again, thanks ??

    Here is the functions.php file with the snippet code that is giving me the error

    edit: so, I noticed the random numbers and the words g sections to any page or postsPHP when I uploaded the pastebin content, so deleted those and renamed my child theme back to customizr-child and that fixed the error message!

    However, the section still isn’t appearing on my home page?

    Hi xephia, yes looks like an issue on copy/past, sometimes happens.
    as you can see in the code you have :

    g sections to any page or postsPHP
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218

    so remove those wrong lines ??

    Ah great you solved ??
    The section doesn’t appear ’cause you have to use that other piece of code to configure it and to run it:

    $my_sections_args = array(
    'ids' => array( 1 , 45 , 47 ),
    'blur' => 0,
    'background' => array( 1 => "randcolors", 45 => 'thumb' , 47 => 'randimages' ),//'randcolors'
    'context' => 'home',
    'hook' => '__before_main_wrapper',
    'apply_shadow' => false,
    'layout' => 'boxed',
    );
    // run
    add_custom_sections ( $my_sections_args );

    Thread Starter xephia

    (@xephia)

    Ahh thank you so much, I’m so embarrassed I didn’t realize! but it works now, thanks again!

    To display custom text instead and a left aligned image unstead of a post, do you know what I would have to change? Or should I make a new thread for that?

    Mmm didn’t get this ??
    Well yes probably would be better to mark this as resolved and open a new topic with more details ??

    Thread Starter xephia

    (@xephia)

    Okay! Thanks again, this was really helpful c:

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Adding section to home page using customizr snippet’ is closed to new replies.